Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find class 'com.google.firebase.FirebaseOptions'

I have a working app and everything was working well, but when I updated it with MoPub app and generated a new signed APK and uploaded it to the play store some users reported a crash while it works well on other users' devices.

I tested the app a lot on different devices and finally found a device that it crashed on.

I debugged the app and found this error code in the android monitor

06-18 16:17:51.665 17951-17951/akhbar4all.com.akhbar4all W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/google/firebase/auth/FirebaseUser;) 06-18 16:17:51.665 17951-17951/akhbar4all.com.akhbar4all E/dalvikvm: Could not find class 'com.google.firebase.FirebaseApp$zza', referenced from method com.google.firebase.FirebaseApp.zza 06-18 16:17:51.665 17951-17951/akhbar4all.com.akhbar4all W/dalvikvm: VFY: unable to resolve check-cast 9003 (Lcom/google/firebase/FirebaseApp$zza;) in Lcom/google/firebase/FirebaseApp; 06-18 16:17:51.665 17951-17951/akhbar4all.com.akhbar4all D/dalvikvm: VFY: replacing opcode 0x1f at 0x0019 06-18 16:17:51.665 17951-17951/akhbar4all.com.akhbar4all D/dalvikvm: DexOpt: unable to opt direct call 0xec65 at 0x0b in Lcom/google/firebase/FirebaseApp;.getToken 06-18 16:17:51.665 17951-17951/akhbar4all.com.akhbar4all D/AndroidRuntime: Shutting down VM 06-18 16:17:51.665 17951-17951/akhbar4all.com.akhbar4all W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41bdc700) 06-18 16:17:51.685 17951-17951/akhbar4all.com.akhbar4all E/AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1214) at android.content.ContentProvider.attachInfo(ContentProvider.java:1189) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5119) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4725) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4665) at android.app.ActivityThread.access$1400(ActivityThread.java:159) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5419) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862) at dalvik.system.NativeStart.main(Native Method)

But I was shocked because I didn't use any Firebase api so why is this happening and what is the solution? I'd be happy for any help from someone.

like image 868
Ali Avatar asked Jun 18 '16 13:06

Ali


1 Answers

I resolved the problem.

The problem was that their is an error in firebase including latest google play services 9.0.2

So i choose only the google play services that i need and not the whole services excluding (firebase) and everything works well

To setup google services by what you need and don't include the whole services visit this link

like image 180
Ali Avatar answered Nov 02 '22 11:11

Ali