evollu / react-native-firebase-analytics

React native bridge for firebase analytics
MIT License
206 stars 54 forks source link

Android problem: DexException: Multiple dex files... #11

Closed beeant closed 8 years ago

beeant commented 8 years ago

Hello,

Thank you for this module. I have successfully setup on the iOS, but I keep on getting this error while compiling for android.

Unknown source file : com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/MessengerCompat$1;
dcworldwide commented 8 years ago

See https://github.com/bamlab/react-native-image-resizer/issues/15. This project had a similar issue and a fix was suggested. @beeant please confirm if it works for you.

sibelius commented 8 years ago

I'm having the same issue using this lib with https://github.com/zo0r/react-native-push-notification

I think both libs depends on google play services is the reason to cause this problem

rturk commented 8 years ago

I'm having the same issue with RN29. I have no idea how to fix this

evollu commented 8 years ago

have you tried cleaning the build?

sibelius commented 8 years ago

as react-native-push-notification and maybe other packages depends on google play services we need match the google play services in this packages

you can run

./gradlew -q app:dependencies

to discover which packages depends on google play services, and which version they r using

them u can force them to use a specific version

dependencies {
   compile ('com.google.android.gms:play-services-gcm:9.2.0') {
        force = true; 
   } 
}
evollu commented 8 years ago

@sibelius can you specify which file needs that change? also react-native-push-notification relies on gms 8.+, could that be an issue?

sibelius commented 8 years ago

u should change android/app/build.gradle

and react-native-push-notification relies on gms 8.+ but u can force another version as above

evollu commented 8 years ago

cool @beeant @rturk does this solve your issue?

rturk commented 8 years ago

@evollu after much work I've managed to make my app work. Thanks. Looks like latest rnpm link still a little bugged and is not correctly importing packages.

evollu commented 8 years ago

cool.

afilp commented 7 years ago

@evollu Hello, I have a similar conflict with "react-native-intercom" but I am not sure what needs to be done there. Should I do something there? Or here?

evollu commented 7 years ago

https://medium.com/@suchydan/how-to-solve-google-play-services-version-collision-in-gradle-dependencies-ef086ae5c75f#.9l0u84y9t