[英]Failed to get FIS auth token on emulator
Im using firebase for sending notification.我使用 firebase 发送通知。
my version of firebase-messages is:我的 firebase-messages 版本是:
implementation ("com.google.firebase:firebase-messaging:20.0.0")
I configure my firebase with google-service.json
我用google-service.json
配置我的 firebase
The weird issue that when I run my app on the emulator on browserstack
I get this error: Failed to get FIS auth token
and java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
奇怪的问题是,当我在browserstack
上的模拟器上运行我的应用程序时,出现此错误: Failed to get FIS auth token
和java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
it seems it comes from the installation它似乎来自安装
but when I run it on physical android device I don't get the error and I succeed to get Token... I checked only on one physical device.In addition I checked on like 10 different emulators devices (include my physical device just on emulator) and they all show the same error.但是当我在物理 android 设备上运行它时,我没有收到错误并且我成功获得了令牌......我只检查了一个物理设备。此外我检查了 10 种不同的仿真器设备(包括我的物理设备就在模拟器),它们都显示相同的错误。
I tried to change the firebase-messaging
to version 20.1.0
but it didn't change anything... I don't understand what might be the issue for that especially that it worked before and I didn't change anything and why it happens only on emulator and not on physical device我试图将 firebase firebase-messaging
更改为20.1.0
版,但它没有改变任何东西......我不明白这可能是什么问题,特别是它之前工作并且我没有改变任何东西以及为什么它只发生在模拟器上而不发生在物理设备上
From my understanding, BrowserStack offers real devices.据我了解,BrowserStack 提供真实设备。 In case the issue doesn't appear on a local device, I would suggest reaching out to the BrowserStack Support team at support@browserstack.com and they should be able to throw some lights towards this.如果问题没有出现在本地设备上,我建议通过 support@browserstack.com 与 BrowserStack 支持团队联系,他们应该能够对此有所了解。
Solution 1解决方案 1
google-services.json
file from firebase console.如果您在 firebase 控制台中进行了任何更改 - 从 firebase 控制台下载并更新google-services.json
文件。Solution 2解决方案 2
If You are using a Real device
Check your Internet connection.如果您使用的是Real device
检查您的 Internet 连接。
If you are using android studio Emulator
- Establish an internet connection by resetting the emulator.如果您使用的是 android 工作室Emulator
- 通过重置模拟器建立互联网连接。
2.1. 2.1。 Open Tools -> AVD manager
打开Tools -> AVD manager
2.2. 2.2. Wipe Data of the emulator擦除模拟器的数据
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.