Firebase Messaging “E/FirebaseCrash: Failed to initialize crash reporting”

1.4k views Asked by At

I am getting this error when initializing my firebase application for Firebase cloud messaging in my main activity.

12-29 17:17:39.253 10361-10361/com.package.android.local E/FirebaseCrash: Failed to initialize crash reporting
    com.google.firebase.crash.internal.zzg$zza: com.google.android.gms.internal.zzsu$zza: No acceptable module found. Local version is 0 and remote version is 0.
        at com.google.firebase.crash.internal.zzg.zzbr(Unknown Source)
        at com.google.firebase.crash.FirebaseCrash.<init>(Unknown Source)
        at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
        at java.lang.reflect.Method.invoke(Native Method)
        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.package.android.activity.MainActivity.onCreate(MainActivity.java:264)

I am initializing firebase like so in my main activity: (note, I am not using google-services.json nor calling apply plugin: 'com.google.gms.google-services' in my build.gradle)

mFirebase = FirebaseApp.initializeApp(this,
                                      new FirebaseOptions.Builder().setGcmSenderId(GCM_SENDER_ID)
                                                                   .setStorageBucket(FIREBASE_STORAGE_URL)
                                                                   .setApiKey(FIREBASE_API_KEY)
                                                                   .setApplicationId(FIREBASE_APP_ID)
                                                                   .setDatabaseUrl(FIREBASE_DB_URL)
                                                                   .build());

My build.gradle dependencies look like so:

dependencies {
    // Play Services
    compile 'com.google.android.gms:play-services-location:9.6.1'
    compile 'com.google.android.gms:play-services-maps:9.6.1'
    compile 'com.google.android.gms:play-services-analytics:9.6.1'
    compile 'com.google.firebase:firebase-core:9.6.1'
    compile 'com.google.firebase:firebase-messaging:9.6.1'
}

Is there anything I can do to prevent the error from occurring? I already have another solution for crash reporting so I don't want to use Firebase Crash but there doesn't seem to be any option to disable it or prevent FirebaseApp from attempting to initialize it.

I have searched and according to this documentation and this other post I should exclude firebase crash from the build.gradle dependencies but it is not included to begin with.

1

There are 1 answers

1
tmtrademark On BEST ANSWER

What version of Google Play Services is present on your device/emulator? I suspect this is really just something unhappy with the version of Play Services which probably isn't handled well in Firebase Crash.

My suspicion is that updating to the latest version (both your SDK and version on the device) is likely to fix your problem. I'm not 100% sure - but it's a good starting place at least!