:app:dexDebug
Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzqf;
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)
:app:dexDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
Fixed,
node_modules/react-native-fcm/android/build.gradel
change
compile 'com.google.firebase:firebase-core:9+'
compile 'com.google.firebase:firebase-messaging:9+'
to
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.2.1'
This solved my issue. I was compiling a project with react-native-maps which was depending on:
compile "com.google.android.gms:play-services-base:9.4.0"
compile 'com.google.android.gms:play-services-maps:9.4.0'
Thank you!!
don't these dependencies belong in the android/app/build.gradle file (another step to installing I know, but what other option do we have?) How else can you match all of these to 9.* for other libraries you have. In my case react-native-maps.
it's really werid issue,
i hadcom.google.android.gms:play-services-auth:9.4.0
And after I update play-services-auth to 10.0.1, problem solved.
Most helpful comment
Fixed,
node_modules/react-native-fcm/android/build.gradel
change
compile 'com.google.firebase:firebase-core:9+'
compile 'com.google.firebase:firebase-messaging:9+'
to
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.2.1'