-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase API initialization failure. (java.lang.IncompatibleClassChangeError) #24
Comments
@iboylmz try updating your dependency to |
@iboylmz closing this issue, please comment if the fix above does not work for you. |
Failed to resolve: 'com.google.firebase:firebase-messaging:9.0.2' while integrating that will project. And my app is not starting anyway. It is saying "firebase api initialization failure". Help me out something. |
Hello @samtstern , the error still occurring with
|
i have the same problem. am trying son hard to use firebase but problems keep arising one after another. am getting tired of this. Please help us out with this. i know Google always has a solution |
Caused by: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.firebase.iid.zzg' appears in /data/data/com.example.michaelokello.erp/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.0.0_e7a33b7a0993c47f35320c5f853852bbb21b5f39-classes.dex) |
@mykfrost please don't double-post issues here. |
Updating gradle to
fix this issue for me. |
Please help me. I see this error: FATAL EXCEPTION: main Project gradle as below: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript {
} allprojects { task clean(type: Delete) { App gradle as below: apply plugin: 'com.android.application' android {
} dependencies { |
Hi guys, I did the same problem and after for very searches I find the solution: Update the dependencies of firebase in the build.gradle with 9.0.2 version This Resolved for me. |
I got this error on 9.4.0 , same error. Could anybody help? Thanks |
@elsennov I solved it by adding the following dependencies to the app gradle file
|
Hi @GiorgioNatili , thanks! Last day i just added firebase-core , then the error was gone. |
I have all of my dependencies set at version 9.4.0, but am still experiencing this exact same issue. Any help? |
@JemarJones In my case I forgot to add an empty constructor to the custom object I wanted to store in the FirebaseDatabase. |
It turns out that i have a separate unrelated issue that i resulting in gradle to fallback to 9.0.0, which results in this issue. So in any case i'm sure 9.4.0 is actually working fine. |
@samtstern Hello. I was trying to config my app for Proguard, which uses Firebase products. First I had following warnings:
The I added these rules to dismiss them: -dontwarn com.google.firebase.**
-dontwarn com.google.android.gms.crash.internal.service.** My release build succeed, but when I launched my app I got similar exceptions like in this issue: E/FirebaseApp( 2969): Firebase API initialization failure.
E/FirebaseApp( 2969): java.lang.reflect.InvocationTargetException
E/FirebaseApp( 2969): at java.lang.reflect.Method.invoke(Native Method)
E/FirebaseApp( 2969): at com.google.firebase.FirebaseApp.a(Unknown Source)
E/FirebaseApp( 2969): at com.google.firebase.FirebaseApp.a(Unknown Source)
E/FirebaseApp( 2969): at com.google.firebase.FirebaseApp.a(Unknown Source)
E/FirebaseApp( 2969): at com.google.firebase.FirebaseApp.a(Unknown Source)
E/FirebaseApp( 2969): at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
E/FirebaseApp( 2969): at android.content.ContentProvider.attachInfo(ContentProvider.java:1751)
E/FirebaseApp( 2969): at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
E/FirebaseApp( 2969): at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
E/FirebaseApp( 2969): at android.app.ActivityThread.installProvider(ActivityThread.java:5811)
E/FirebaseApp( 2969): at android.app.ActivityThread.installContentProviders(ActivityThread.java:5403)
E/FirebaseApp( 2969): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5342)
E/FirebaseApp( 2969): at android.app.ActivityThread.-wrap2(ActivityThread.java)
E/FirebaseApp( 2969): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1528)
E/FirebaseApp( 2969): at android.os.Handler.dispatchMessage(Handler.java:102)
E/FirebaseApp( 2969): at android.os.Looper.loop(Looper.java:154)
E/FirebaseApp( 2969): at android.app.ActivityThread.main(ActivityThread.java:6077)
E/FirebaseApp( 2969): at java.lang.reflect.Method.invoke(Native Method)
E/FirebaseApp( 2969): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
E/FirebaseApp( 2969): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
E/FirebaseApp( 2969): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzud;
E/FirebaseApp( 2969): at com.google.firebase.crash.internal.config.flag.Flags.<clinit>(Unknown Source)
E/FirebaseApp( 2969): at com.google.firebase.crash.internal.config.flag.Flags.initialize(Unknown Source)
E/FirebaseApp( 2969): at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
E/FirebaseApp( 2969): ... 20 more
E/FirebaseApp( 2969): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.zzud" on path: DexPathList[[zip file "/data/app/tm.asmanoky.aziada-1/base.apk"],nativeLibraryDirectories=[/data/app/tm.asmanoky.aziada-1/lib/x86, /data/app/tm.asmanoky.aziada-1/base.apk!/lib/x86, /system/lib, /vendor/lib]]
E/FirebaseApp( 2969): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/FirebaseApp( 2969): at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
E/FirebaseApp( 2969): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/FirebaseApp( 2969): ... 23 more Could you please suggest me proper the proguard rules when using firebase crash? Thank you. |
@alashow what version of the client library are you using? As far as I am aware there are no specific proguard rules needed to use Firebase Crash but I could be missing something. |
Hi everyone! java.lang.IncompatibleClassChangeError: com.google.android.gms.internal.zzade$zzc$1 att this code: mFBConfig.fetch(3600) mFBConfig.fetch(3600).addOnCompleteListener(this, new OnCompleteListener() {
Did someone know how to solv this problem??? Tanks |
All mt libraries are updated... |
I updated gradle to
it solved for me :) |
I must set firebase-core version the same |
Hi,
this line causing en error:
05-26 15:52:42.551 11612-11612/com.lotram.uygulamacoapp A/FirebaseApp: Firebase API initialization failure. java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.google.firebase.FirebaseApp.zza(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1714) at android.content.ContentProvider.attachInfo(ContentProvider.java:1683) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5012) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4607) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547) at android.app.ActivityThread.access$1500(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) Caused by: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.google.firebase.FirebaseApp.zza(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1714) at android.content.ContentProvider.attachInfo(ContentProvider.java:1683) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5012) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4607) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547) at android.app.ActivityThread.access$1500(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) 05-26 15:52:43.401 11612-11612/com.lotram.uygulamacoapp E/ApkAssets: Error while loading asset assets/icudtl.dat: java.io.FileNotFoundException: assets/icudtl.dat 05-26 15:52:44.017 11612-11612/com.lotram.uygulamacoapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.lotram.uygulamacoapp, PID: 11612 java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.messaging.FirebaseMessaging.getInstance(Unknown Source) at com.lotram.uygulamacoapp.MainActivity.onCreate(MainActivity.java:51) at android.app.Activity.performCreate(Activity.java:5977) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2258) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) at android.app.ActivityThread.access$800(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) 05-26 15:59:59.507 17613-17613/com.lotram.uygulamacoapp A/FirebaseApp: Firebase API initialization failure. java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.google.firebase.FirebaseApp.zza(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1714) at android.content.ContentProvider.attachInfo(ContentProvider.java:1683) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5012) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4607) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547) at android.app.ActivityThread.access$1500(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) Caused by: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.google.firebase.FirebaseApp.zza(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1714) at android.content.ContentProvider.attachInfo(ContentProvider.java:1683) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5012) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4607) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547) at android.app.ActivityThread.access$1500(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) 05-26 16:00:00.275 17613-17613/com.lotram.uygulamacoapp E/ApkAssets: Error while loading asset assets/icudtl.dat: java.io.FileNotFoundException: assets/icudtl.dat 05-26 16:00:00.694 17613-17613/com.lotram.uygulamacoapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.lotram.uygulamacoapp, PID: 17613 java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.messaging.FirebaseMessaging.getInstance(Unknown Source) at com.lotram.uygulamacoapp.MainActivity.onCreate(MainActivity.java:64) at android.app.Activity.performCreate(Activity.java:5977) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2258) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) at android.app.ActivityThread.access$800(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
my app/build.gradle
and my project/build.gradle
The text was updated successfully, but these errors were encountered: