Hi, @evollu !
i want help to guys to fix this issue with multiple dex ,etc.
really working solution is forking needed repos, and change dependency versions in build.gradle at /node_modules/{NAME_LIB}/android/build.gradle, to bring to one appearence
e.g, in my project i need [email protected] and [email protected] in maps lib build.gradle was set:
compile "com.google.android.gms:play-services-base:9.8.0"
compile "com.google.android.gms:play-services-maps:9.8.0"
and in fcm:
compile 'com.google.firebase:firebase-core:+'
compile 'com.google.firebase:firebase-messaging:+'
so that we need change build.gradle file our fcm lib so that it looks as follows, and error will disappear=)
compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-messaging:9.8.0'
add this ad README.md file, for someone it may be useful)
thank you
@andryuwka please search the issues
the solution is to force a specific version of firebase-core
@sibelius i searched solution in this two repos, and i tryied force change version and excluding dependencies, but nothing helped.
can you show me, what i need to do?
now my app build.gradle dependencies looks like this:
compile project(':react-native-fcm')
compile project(':react-native-maps')
compile project(':react-native-spinkit')
compile ('com.android.support:appcompat-v7:25.0.1') {
exclude group: 'com.google.android', module: 'support-v4'
}
compile ('com.google.firebase:firebase-core:9.8.0')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.facebook.react:react-native:+" // From node_modules
compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
transitive = true;
}
and at the bottom, there is a line with apply plugin: "com.google.gms.google-services"
u should use the latest version of firebase-core
yeah, i can read instructions=) but it's not helped to me)
https://github.com/evollu/react-native-fcm#im-getting-comandroiddexdexexception-multiple-dex-files-define-lcomgoogleandroidgmsinternalzzqf
i have already read this, but no effect
I write whole article about this problem:
https://medium.com/@suchydan/how-to-solve-google-play-services-version-collision-in-gradle-dependencies-ef086ae5c75f#.9l0u84y9t
Hope I helped you :)
@Nodonisko you are awesome!!! it works!
@evollu i think that you can close this issue and post this solution at README.md
it is in readme FAQ section.
I will include @Nodonisko 's article
https://github.com/airbnb/react-native-maps/issues/831
worked for me!
It solve my issue on @Nodonisko's article, I suggest add his solution in README.md because on my first try this is the error I got when I install RN.FCM
I had this problem, and this was my solution:
Add compile 'com.google.android.gms:play-services-gcm:+' to the dependeencies in
/node_modules/react-native-fcm/android/build.gradle
Im not experinced in Android, but seems to me that if we configure the version of that library in the build.gradle of the app, it will create conflict with other existent modules that has already that library as a dependence, perhaps with different version.
To avoid that, I added the dependence in the build.gradle of the module itself, and now every module works with the version it needs.
(This is my own interpretation, may be wrong but the fix worked for me.. I hope it helps you.. Cheers!!)
the repo doesn't have dependency on com.google.android.gms:play-services-gcm:+ and we already have
compile 'com.google.firebase:firebase-core:+'
compile 'com.google.firebase:firebase-messaging:+'
in /node_modules/react-native-fcm/android/build.gradle
@Nodonisko an absolute legend!
Most helpful comment
I write whole article about this problem:
https://medium.com/@suchydan/how-to-solve-google-play-services-version-collision-in-gradle-dependencies-ef086ae5c75f#.9l0u84y9t
Hope I helped you :)