Failed on android with com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpq;

On Android gradles build process gives the following exception:

Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpq;
Unknown source file :   at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
Unknown source file :   at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
Unknown source file :   at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
Unknown source file :   at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Unknown source file :   at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
Unknown source file :   at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
Unknown source file :   at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
Unknown source file :   at com.android.dx.command.dexer.Main.run(Main.java:277)
Unknown source file :   at com.android.dx.command.dexer.Main.main(Main.java:245)
Unknown source file :   at com.android.dx.command.Main.main(Main.java:106)

When removing react-native-device-info-stuff from build.gradle, settings.gradle and MainActivity.java, everything works fine.

2 thoughts on “Failed on android with com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpq;

  1. Resolve with that in android/app/build.gradle :

    compile (project(':react-native-device-info')){
           exclude group: "com.google.android.gms" 
    }

Comments are closed.

Failed on android with com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpq;

On Android gradles build process gives the following exception:

Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpq;
Unknown source file :   at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
Unknown source file :   at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
Unknown source file :   at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
Unknown source file :   at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Unknown source file :   at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
Unknown source file :   at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
Unknown source file :   at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
Unknown source file :   at com.android.dx.command.dexer.Main.run(Main.java:277)
Unknown source file :   at com.android.dx.command.dexer.Main.main(Main.java:245)
Unknown source file :   at com.android.dx.command.Main.main(Main.java:106)

When removing react-native-device-info-stuff from build.gradle, settings.gradle and MainActivity.java, everything works fine.

2 thoughts on “Failed on android with com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpq;

  1. Resolve with that in android/app/build.gradle :

    compile (project(':react-native-device-info')){
           exclude group: "com.google.android.gms" 
    }

Comments are closed.