Firebase Messaging“E / FirebaseCrash:无法初始化崩溃报告”

时间:2016-12-30 00:10:07

标签: android firebase google-play-services firebase-cloud-messaging firebase-crash-reporting

在我的主要活动中初始化Firebase云消息传递的firebase应用程序时出现此错误。

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)

我正在我的主要活动中初始化firebase: (注意,我没有使用google-services.json,也没有在build.gradle中调用apply plugin: 'com.google.gms.google-services'

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());

我的build.gradle依赖项看起来像这样:

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'
}

我能做些什么来防止错误发生?我已经有了另一个崩溃报告解决方案,因此我不想使用Firebase崩溃,但似乎没有任何选项可以禁用它或阻止FirebaseApp尝试初始化它。

我已根据this documentationthis other post进行了搜索,我应该从build.gradle依赖项中排除firebase崩溃,但它不会包含在内。

1 个答案:

答案 0 :(得分:1)

您的设备/模拟器上有哪些版本的Google Play服务?我怀疑这只是对Play服务版本不满意的事情,可能在Firebase Crash中处理得不好。

我怀疑更新到最新版本(您的SDK和设备上的版本)可能会解决您的问题。我不是百分百肯定 - 但它至少是一个很好的起点!