question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible conflict with react-native-firebase

See original GitHub issue

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'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
LordParsleycommented, Nov 15, 2017

Based on @leethree 's comment, I worked around this with:

dependencies {
    compile(project(':react-native-device-info')) {
        exclude group: 'com.google.android.gms', module: 'play-services-gcm'
    }
    compile(project(':react-native-firebase')) {
        transitive = false
    }
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:25.3.1"
    compile "com.google.firebase:firebase-core:11.4.2"
    compile "com.google.firebase:firebase-messaging:11.4.2"
    compile "com.google.android.gms:play-services-base:11.4.2"
    compile "com.google.android.gms:play-services-gcm:11.4.2"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

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):

dependencies {
    compile 'com.facebook.react:react-native:+'
    compile 'com.google.android.gms:play-services-gcm:+'
}

From react-native-firebase’s gradle file (because they target a specific compatible version):

buildscript {
  ext.firebaseVersion = '11.4.2'
  ...
}
...
dependencies {
  ...
  compile "com.google.android.gms:play-services-base:$firebaseVersion"
  ...
}
4reactions
vovanmozgcommented, Jul 6, 2017

I have trouble with start an app on the android device. Build is success.

adb logcat:

07-06 19:55:58.154  1678  2225 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.my.app.sa/.MainActivity bnds=[24,239][230,517] (has extras)} from uid 10021 on display 0
07-06 19:55:58.161  1419  1441 W audio_hw_generic: Not supplying enough data to HAL, expected position 839800 , only wrote 839520
07-06 19:55:58.169  3837  3837 I art     : Not late-enabling -Xcheck:jni (already on)
07-06 19:55:58.170  3837  3837 W art     : Unexpected CPU variant for X86 using defaults: x86
07-06 19:55:58.177  1678  1984 I ActivityManager: Start proc 3837:com.my.app.sa/u0a86 for activity com.my.app.sa/.MainActivity
07-06 19:55:58.204  3837  3837 D AndroidRuntime: Shutting down VM
07-06 19:55:58.205  3837  3837 E AndroidRuntime: FATAL EXCEPTION: main
07-06 19:55:58.205  3837  3837 E AndroidRuntime: Process: com.my.app.sa, PID: 3837
07-06 19:55:58.205  3837  3837 E AndroidRuntime: java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzbr; or its super classes (declaration of 'com.google.android.gms.common.internal.zzbr' appears in /data/app/com.my.app.sa-2/base.apk)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at android.app.ActivityThread.-wrap2(ActivityThread.java)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6119)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
07-06 19:55:58.205  3837  3837 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
07-06 19:55:58.207  1678  1689 W ActivityManager:   Force finishing activity com.my.app.sa/.MainActivity
07-06 19:55:58.268  2270  2270 W SearchService: Abort, client detached.
07-06 19:55:58.281  1678  3452 I OpenGLRenderer: Initialized EGL, version 1.4
07-06 19:55:58.281  1678  3452 D OpenGLRenderer: Swap behavior 1
07-06 19:55:58.281  1678  3452 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
07-06 19:55:58.281  1678  3452 D OpenGLRenderer: Swap behavior 0
07-06 19:55:58.282  1678  3452 D EGL_emulation: eglCreateContext: 0xaef87040: maj 2 min 0 rcv 2
07-06 19:55:58.286  1678  3452 D EGL_emulation: eglMakeCurrent: 0xaef87040: ver 2 0 (tinfo 0x907fffb0)
07-06 19:55:58.295  1678  3452 D EGL_emulation: eglMakeCurrent: 0xaef87040: ver 2 0 (tinfo 0x907fffb0)
07-06 19:55:58.713  1678  1692 W ActivityManager: Activity pause timeout for ActivityRecord{e58df8d u0 com.my.app.sa/.MainActivity t7 f}
07-06 19:55:58.723  1678  1692 I WindowManager: Failed to capture screenshot of Token{4025542 ActivityRecord{e58df8d u0 com.my.app.sa/.MainActivity t7 f}} appWin=Window{6ebdfcb u0 Starting com.my.app.sa} drawState=3

IOS app is ok

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash on Android, possible conflict with react-native-firebase ...
The only conclusion I have is that it is not related to firebase problem, it is related to xcode and react native problem,...
Read more >
react-native-firebase pod version conflict for Firebase/CoreOnly
The problem is that @react-native-firebase/config appears unrelated to the ... hence the different latest version and pod conflicts.
Read more >
Migrating to v6 - React Native Firebase
React Native Firebase version 6 has been re-created from the ground up, with a heavy focus on testing, documentation & feature compatibility with...
Read more >
Handling dependencies conflict and locking in React Native
We can see that both react-native-firebase-analytics and react-native-onesignal depends on com.google.android.gms:play-services-basement but ...
Read more >
Firebase Android SDK Release Notes - Google
Fixed an issue preventing native crashes from being reported for Android API 29+. ... The App Distribution Android SDK is now available in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found