REPOST:无法获取FIS身份验证令牌



我试图使用下面的代码行获取令牌,但由于您可以看到控制台输出,因此出现了错误。我很久以前就这么做了,而且效果很好。我不知道现在出了什么问题。有人能帮我解决这个问题吗。

var token=等待FirebaseMessaging。instance.getToken((;

E/FirebaseMessaging(29973): Failed to get FIS auth token
E/FirebaseMessaging(29973): java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseMessaging(29973):     at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-tasks@@18.0.1:5)
E/FirebaseMessaging(29973):     at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-tasks@@18.0.1:8)
E/FirebaseMessaging(29973):     at com.google.firebase.messaging.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-messaging@@23.0.0:10)
E/FirebaseMessaging(29973):     at com.google.firebase.messaging.GmsRpc.startRpc(com.google.firebase:firebase-messaging@@23.0.0:1)
E/FirebaseMessaging(29973):     at com.google.firebase.messaging.GmsRpc.getToken(com.google.firebase:firebase-messaging@@23.0.0:1)
E/FirebaseMessaging(29973):     at com.google.firebase.messaging.FirebaseMessaging.lambda$blockingGetToken$9$com-google-firebase-messaging-FirebaseMessaging(com.google.firebase:firebase-messaging@@23.0.0:1)
E/FirebaseMessaging(29973):     at com.google.firebase.messaging.FirebaseMessaging$$ExternalSyntheticLambda5.start(Unknown Source:6)
E/FirebaseMessaging(29973):     at com.google.firebase.messaging.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-messaging@@23.0.0:6)
E/FirebaseMessaging(29973):     at com.google.firebase.messaging.FirebaseMessaging.blockingGetToken(com.google.firebase:firebase-messaging@@23.0.0:7)
E/FirebaseMessaging(29973):     at com.google.firebase.messaging.FirebaseMessaging.lambda$getToken$3$com-google-firebase-messaging-FirebaseMessaging(com.google.firebase:firebase-messaging@@23.0.0:1)
E/FirebaseMessaging(29973):     at com.google.firebase.messaging.FirebaseMessaging$$ExternalSyntheticLambda10.run(Unknown Source:4)
E/FirebaseMessaging(29973):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
E/FirebaseMessaging(29973):     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/FirebaseMessaging(29973):     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
E/FirebaseMessaging(29973):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/FirebaseMessaging(29973):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseMessaging(29973):     at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@18.0.0:2)
E/FirebaseMessaging(29973):     at java.lang.Thread.run(Thread.java:923)
E/FirebaseMessaging(29973): Caused by: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseMessaging(29973):     at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(FirebaseInstallationServiceClient.java:158)
E/FirebaseMessaging(29973):     at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(FirebaseInstallations.java:533)
E/FirebaseMessaging(29973):     at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:388)
E/FirebaseMessaging(29973):     at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2$FirebaseInstallations(FirebaseInstallations.java:377)
E/FirebaseMessaging(29973):     at com.google.firebase.installations.-$$Lambda$FirebaseInstallations$VZq1h0TBcWNH8Y5yY86ujrFFyLo.run(Unknown Source:4)
E/FirebaseMessaging(29973):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/FirebaseMessaging(29973):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseMessaging(29973):     ... 1 more
E/flutter (29973): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: [firebase_messaging/unknown] java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: FIS_AUTH_ERROR
E/flutter (29973): #0      MethodChannelFirebaseMessaging.getToken
package:firebase_messaging_platform_interface/…/method_channel/method_channel_messaging.dart:229
E/flutter (29973): <asynchronous suspension>
E/flutter (29973): #1      _HomeState.getToken
package:smart_car_parking/…/Home/home.dart:30
E/flutter (29973): <asynchronous suspension>

问题解决:我没有在GCP 中添加新的SHA1密钥

删除当前的json文件,获取一个新文件。将项目与渐变文件同步,然后清理您的项目。

相关内容

  • 没有找到相关文章

最新更新