FirebaseMessagingService.zzo上的NullPointerException(未知来源)

时间:2016-08-24 11:39:37

标签: android firebase nullpointerexception firebase-cloud-messaging

有谁知道这次崩溃?

Fatal Exception: java.lang.NullPointerException
       at com.google.firebase.messaging.FirebaseMessagingService.zzo(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
       at com.google.firebase.iid.zzb$2.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
       at java.lang.Thread.run(Thread.java:856)

不会发生这么多,大约0.1%的会话。

报告的环境:GI-I9500_TMMARS / Android 4.1.1。

3 个答案:

答案 0 :(得分:4)

快速启动项目的问题是discussed as an issue。来自Firebase支持团队的评论表明问题已在SDK版本9.4.0中得到修复。你在用那个版本建造吗?

答案 1 :(得分:0)

在我的情况下,我使用错误的键来获取价值

Map data = remoteMessage.getData();
String name;
name = data.get("naem").toString());
//while correct key is name not naem

答案 2 :(得分:-1)

要修复此错误,您应该更新Gradle文件中的firebase并添加第二行:

compile 'com.google.firebase:firebase-messaging:10.0.1' 
compile 'com.google.firebase:firebase-core:10.0.1' // also need to add this line.

获取" 无法找到"错误? 确保你拥有    Android SDK管理器中的最新Google Repository

不要忘记更新项目根文件夹中的Gradle文件,否则您将无法获得版本 10.0.1

buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

源:

https://github.com/firebase/quickstart-android/issues/185 https://firebase.google.com/docs/android/setup