Skip to content
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

Closed
ibrahimyilmaz7 opened this issue May 26, 2016 · 23 comments

Comments

@ibrahimyilmaz7
Copy link

ibrahimyilmaz7 commented May 26, 2016

Hi,

    FirebaseMessaging.getInstance().subscribeToTopic("global");

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

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.lotram.uygulamacoapp"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    maven {
        url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    compile 'org.xwalk:xwalk_core_library:17.46.448.10'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'org.apache.commons:commons-io:1.3.2'

    compile 'com.google.firebase:firebase-messaging:9.0.0'
}

apply plugin: 'com.google.gms.google-services'

and my project/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

@ibrahimyilmaz7 ibrahimyilmaz7 changed the title Firebase API initialization failure. Firebase API initialization failure. (java.lang.IncompatibleClassChangeError) May 26, 2016
@samtstern
Copy link
Contributor

@iboylmz try updating your dependency to compile 'com.google.firebase:firebase-messaging:9.0.2', I believe this bug was fixed in the patches between 9.0.0 and 9.0.2.

@samtstern
Copy link
Contributor

@iboylmz closing this issue, please comment if the fix above does not work for you.

@Purvik
Copy link

Purvik commented Jun 22, 2016

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.

@dsdebastiani
Copy link

Hello @samtstern , the error still occurring with 9.0.2
Log:

07-06 15:26:57.485 3897-3897/ 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:1696)
    at android.content.ContentProvider.attachInfo(ContentProvider.java:1671)
    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
    at android.app.ActivityThread.installProvider(ActivityThread.java:5084)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4679)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4619)
    at android.app.ActivityThread.access$1500(ActivityThread.java:155)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1378)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5343)
    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:905)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
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:1696) 
    at android.content.ContentProvider.attachInfo(ContentProvider.java:1671) 
    at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
    at android.app.ActivityThread.installProvider(ActivityThread.java:5084) 
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4679) 
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4619) 
    at android.app.ActivityThread.access$1500(ActivityThread.java:155) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1378) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:135) 
    at android.app.ActivityThread.main(ActivityThread.java:5343) 
    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:905) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

@mykfrost
Copy link

mykfrost commented Jul 20, 2016

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

@mykfrost
Copy link

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)

@samtstern
Copy link
Contributor

@mykfrost please don't double-post issues here.

@ibrahimyilmaz7
Copy link
Author

Updating gradle to

compile 'com.google.firebase:firebase-messaging:9.0.0

fix this issue for me.

@gentjana
Copy link

gentjana commented Aug 4, 2016

Please help me. I see this error:

FATAL EXCEPTION: main
Process: com.example.aneg2_000.firebasenotificationapp, PID: 2303
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.(Unknown Source)
at com.google.firebase.iid.zzg.(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.example.aneg2_000.firebasenotificationapp.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Project gradle as below:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

App gradle as below:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
    applicationId "com.example.aneg2_000.firebasenotificationapp"
    minSdkVersion 9
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.google.firebase:firebase-messaging:9.0.2'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
}

@thomaskanzig
Copy link

thomaskanzig commented Aug 6, 2016

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
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-messaging:9.0.2'

This Resolved for me.

@elsennov
Copy link

elsennov commented Sep 2, 2016

I got this error on 9.4.0 , same error. Could anybody help? Thanks

@GiorgioNatili
Copy link

@elsennov I solved it by adding the following dependencies to the app gradle file

    compile 'com.google.firebase:firebase-database:9.4.0'
    compile 'com.google.firebase:firebase-core:9.4.0'
    compile 'com.google.firebase:firebase-auth:9.4.0'
    compile 'com.google.firebase:firebase-config:9.4.0'

@elsennov
Copy link

elsennov commented Sep 3, 2016

Hi @GiorgioNatili , thanks! Last day i just added firebase-core , then the error was gone.

@JemarJones
Copy link

I have all of my dependencies set at version 9.4.0, but am still experiencing this exact same issue. Any help?

@doppie
Copy link

doppie commented Sep 12, 2016

@JemarJones In my case I forgot to add an empty constructor to the custom object I wanted to store in the FirebaseDatabase.

@JemarJones
Copy link

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.

@alashow
Copy link

alashow commented Dec 29, 2016

@samtstern Hello. I was trying to config my app for Proguard, which uses Firebase products.

First I had following warnings:

Warning: com.google.firebase.crash.FirebaseCrash: can't find referenced class com.google.android.apps.common.proguard.UsedByReflection
Warning: com.google.firebase.crash.internal.config.flag.Flags: can't find referenced class com.google.android.gms.internal.zzud
Warning: com.google.android.gms.crash.internal.service.CrashReceiverService: can't find referenced method 'com.google.android.gms.dynamic.zzd zzae(java.lang.Object)' in program class com.google.android.gms.dynamic.zze

(all of them)

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.

@samtstern
Copy link
Contributor

@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.

@paulonova
Copy link

Hi everyone!
I need a help with my Firebase Remote Config that shows this error:

java.lang.IncompatibleClassChangeError: com.google.android.gms.internal.zzade$zzc$1

att this code: mFBConfig.fetch(3600)

mFBConfig.fetch(3600).addOnCompleteListener(this, new OnCompleteListener() {
@OverRide
public void onComplete(@nonnull Task task) {
if (task.isSuccessful()) {
Log.i(TAG, "Promo check successful");

                // If the fetch was successful, then "activate" the
                // values that were retrieved from the server
                mFBConfig.activateFetched();
            }
            else {
                Log.e(TAG, "Promo check failed");
            }

            showPromoButton();
        }
    });

Did someone know how to solv this problem???

Tanks
Paulo

@paulonova
Copy link

All mt libraries are updated...

@mohrezani
Copy link

mohrezani commented Mar 27, 2017

I updated gradle to

compile 'com.google.firebase:firebase-messaging:9.0.2

it solved for me :)

@SwayChen
Copy link

I must set firebase-core version the same

@zsigmondszilveszter
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests