react-native-device-info: Possible conflict with react-native-firebase
Hi, thanks for a great module 😃
I have react-native-firebase working, and when I add react-native-device-info, I get the below error when running ‘gradlew.bat installDebug’ - any advice on how to get it working?
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzbaz;
Misc info:
compileSdkVersion 23
buildToolsVersion "23.0.2"
minSdkVersion 16
targetSdkVersion 23
android/build.gradle dependencies:
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 15 (1 by maintainers)
Based on @leethree 's comment, I worked around this with:
The problem is caused by mixing Google Play Services dependencies.
From
react-native-device-info
’s gradle file (as a dependency, using+
is arguably the best approach):From
react-native-firebase
’s gradle file (because they target a specific compatible version):I have trouble with start an app on the android device. Build is success.
adb logcat:
IOS app is ok
This solution works for me: https://github.com/rebeccahughes/react-native-device-info/issues/245#issuecomment-336394802
I’ve manage to solve this by adding
compile 'com.google.firebase:firebase-core:11.0.2'
inside
android/app/build.gradle
and of course, at the bottom of the file :
apply plugin: 'com.google.gms.google-services'