react-native-device-info: Unable to merge dex

I get this error when I add this plugin to my project:

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 26

Most upvoted comments

@machour ,

Thanks, its works. Solution is:


dependencies {
  compile 'com.google.firebase:firebase-core:11.8.0' //Added this line
}

This is now mentioned in the troubleshooting section of the README file.

@paintedbicycle I’m planning to drop the dependency in 1.0.0 (#307), can’t do it prior to a BC breaking release

@machour @kylesziv

I added this line at <PROJECT LOCATION>/android/app/build.gradle

Add multiDexEnabled true

defaultConfig {
        applicationId "com.xxx"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

Works for me!

delete the build folder in android build folder build it again