FirebaseCrash: Failed to initialize crash reportin

2019-05-10 08:34发布

问题:

I am getting following error in my logcat while trying to use Firebase Crash Reporting:

FirebaseCrash: Failed to initialize crash reporting

FirebaseCrash: com.google.firebase.crash.internal.zzg$zza: com.google.android.gms.internal.zzsb$zza: No acceptable module found. Local version is 0 and remote version is 0.

I have added the following in module app project and build gradle:

   classpath 'com.google.gms:google-services:3.0.0'
   compile 'com.google.firebase:firebase-core:9.4.0'
   compile 'com.google.firebase:firebase-ads:9.4.0'
   compile 'com.google.firebase:firebase-crash:9.4.0`

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

and added google-services.json in the app folder.

I got the Firebase Analytics working after the 24 hours, time limit for first updates. For getting the first error I have added in MainCctivity.

FirebaseCrash.report(new Exception("My first Android non-fatal error"));

The Google Play Services I use is version 9.4.52(238-127739847) in my emulator (Nexus Api 23, Android Version 6.0). Still the error is shown in logcat , how can I get the crash report working?

回答1:

The bottom line here is that Firebase Crash Reporting only works on devices with Google Play services, and that its version needs to match or exceed the Firebase client library version.

If you are running in an emulator, you need to use an image with Play services installed.