Hi,
I'm using react-native-firebase and according to their docs, I have to install this library in order to setup google signin.
After I link this library using react-native link react-native-google-signin and build the app, it crashes at startup.
When I check the output of adb logcat AndroidRuntime:E *:E, I get the following:
FATAL EXCEPTION: main
Process: app.namespace.goes.here, PID: 14138
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;
at com.google.firebase.perf.provider.FirebasePerfProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5213)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4808)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4748)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5480)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/app.namespace.goes.here-2/base.apk"],nativeLibraryDirectories=[/data/app/app.namespace.goes.here-2/lib/x86, /data/app/app.namespace.goes.here-2/base.apk!/lib/x86, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 12 more
Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.common.internal.zzbq
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Dependencies:
"dependencies": {
"fbjs": "^0.8.16",
"react": "^16.3.0-alpha.1",
"react-native": "^0.54.4",
"react-native-firebase": "^4.0.0",
"react-native-google-signin": "^0.11.0"
}
Any ideas why this is happening ?
Thanks in advance.
I am experiencing the same error. Bump.
@MhdSyrwan I had a look at the example:
https://github.com/devfd/react-native-google-signin/blob/master/example/android/app/build.gradle
I changed:
implementation(':react-native-google-signin')
To:
implementation(project(':react-native-google-signin')){
exclude group: "com.google.android.gms"
}
Hope that helps.
@uppercase-army After applying the fix, it doesn't crash currently, but it's giving the following error
java.lang.NoClassDefFoundError: com.google.android.gms.auth.api.signin.GoogleSignInResult
Meanwhile, implementation "com.google.android.gms:play-services-base:12.0.1" is included in my gradle file afterwards.
@MhdSyrwan
Can you give me a full stack trace? Also when is this error happening, on build or runtime or tapping on Google Sign in?
Also have you compared your android files with the examples one? It's likely there is a small difference between yours and theirs.
it's happening at runtime when i start the app.
I will compare my android folder with the example one this evening.
Regarding the stack trace, sorry for the inconvenience, I couldn't get a text version of it (copy button is not working for some reason).


Please check out our example app it has been updated and it's working.
If problem still persists please open new issue with a reproducible example so we can debug it.
thank you.
Posting here in case anyone else struggles with it: In my case the proposed "exclude" did not work. This solution seems to solve it: https://stackoverflow.com/questions/49953439/app-crashing-on-start-after-adding-react-native-firebase-in-android
Once I set libraries to version 15.0.0 things worked as expected. Note: I did not use the "force: true" option in build.gradle.
I think the reason I was having those issues is because I'm also using react-native-fcm.
The solution for me was to move the implementation 'com.google.android.gms:play-services-auth:15.0.1' as the last line in the dependencies. 🤦♂️
@uppercase-army Really thank you so much i searched more than a month finally get work thank :)
Most helpful comment
@MhdSyrwan I had a look at the example:
https://github.com/devfd/react-native-google-signin/blob/master/example/android/app/build.gradle
I changed:
implementation(':react-native-google-signin')
To:
implementation(project(':react-native-google-signin')){
exclude group: "com.google.android.gms"
}
Hope that helps.