React Native: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'

后端 未结 17 2235
[愿得一人]
[愿得一人] 2020-12-30 01:15

I\'ve tried gradlew clean and every other solution available here and on GitHub but the error doesn\'t match and solution doesn\'t work

Error on cmd A

相关标签:
17条回答
  • 2020-12-30 01:38

    Just run

    cd android && gradlew clean
    

    then

    cd .. && react-native run-android
    
    0 讨论(0)
  • 2020-12-30 01:39

    As an update to this answer (if people can't figure out why, especially one Mac)

    use sudo! I was trying to figure out why gradlew commands were not running for ages, turns out - it didnt have permission!

    Use:

    sudo ./gradlew [command]

    I'm so frustrated and happy at the same time.

    0 讨论(0)
  • 2020-12-30 01:41

    I have the same issue. So to make it 'clearer', I did these:

    1. Update to sdk27 (compile and target). minSdk is at 21
    2. Update related goodle-play base/services/maps to 15.0.1 (Depends on your project requirement)
    3. Then: I add multidexEnabled=true in the same section as no (1) above
    4. (Optional) - I had another issue where Gradle couldn't find the play-services version properly: I modified the project build.gradle to search the google maven first before the jcenter()

      maven {
          url 'https://maven.google.com/'
          name 'Google'
      }
      mavenLocal()
      jcenter()
      
    0 讨论(0)
  • 2020-12-30 01:42

    Open the /android/app/build.gradle file.

    Under dependencies we need to add the module, and then enable it within defaultConfig

    android {
        defaultConfig {
            // ...
            multiDexEnabled true
        }
        // ...
    }
    
    dependencies {
      implementation 'com.android.support:multidex:1.0.3'
    }
    
    0 讨论(0)
  • 2020-12-30 01:42

    me too had this same error, and i was able to debug it using the command ./gradlew assembleDebug --stacktrace(inside android folder) and for me it was because i had two libraries and both were having same package name, on changing package name of one resolved the issue

    0 讨论(0)
提交回复
热议问题