Firebase FCM令牌异常

时间:2018-10-08 15:19:24

标签: android firebase firebase-cloud-messaging

我不知道何时开始调试,在开发应用程序时遇到致命异常。

E/AndroidRuntime: FATAL EXCEPTION: TokenRefresher
              Process: com.bitwise.rotaractclubapp, PID: 22226
              java.lang.NoSuchFieldError: No static field PREFER_HIGHEST_OR_REMOTE_VERSION_NO_FORCE_STAGING of type Lcom/google/android/gms/dynamite/DynamiteModule$VersionPolicy; in class Lcom/google/android/gms/dynamite/DynamiteModule; or its superclasses (declaration of 'com.google.android.gms.dynamite.DynamiteModule' appears in /data/app/com.bitwise.rotaractclubapp-2/base.apk)
                  at com.google.android.gms.flags.c.a(Unknown Source)
                  at com.google.android.gms.flags.b.a(Unknown Source)
                  at com.google.firebase.auth.internal.aa.a(Unknown Source)
                  at com.google.firebase.auth.internal.x.run(Unknown Source)
                  at android.os.Handler.handleCallback(Handler.java:739)
                  at android.os.Handler.dispatchMessage(Handler.java:95)
                  at android.os.Looper.loop(Looper.java:148)
                  at android.os.HandlerThread.run(HandlerThread.java:61)

这是在重新安装应用程序时发生的,当用户登录或像这样打开应用程序时,我正在将设备令牌保存在数据库中。

 FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(new OnSuccessListener<InstanceIdResult>() {
    @Override
    public void onSuccess(InstanceIdResult instanceIdResult) {
        mDatabase.collection("Collection")
            .document(FirebaseAuth.getInstance().getCurrentUser().getUid())
            .update("token", instanceIdResult.getToken());
    }
});

我该如何解决?

0 个答案:

没有答案