FireBaseInstanceId服务未注册。

8 浏览
0 Comments

FireBaseInstanceId服务未注册。

我正在尝试运行这里提供的演示。问题是每当应用程序尝试注册instanceId时,它会显示"后台同步失败:MISSING_INSTANCEID_SERVICE,将在320秒后重试",然后当我打印token时,它显示token为空。我尝试了将INSTANCE_ID_EVENT更改为INSTANCEID_EVENT和其他之前在stackoverflow上提出的解决方案,但都对我无效。

0
0 Comments

当在模拟器上运行时,使用带有Google APIs的映像。

This error occurs when attempting to register the Firebase Instance ID service in an emulator without the Google APIs image.

解决方法:

1. 在Android Studio中打开AVD Manager(Android Virtual Device Manager)。

2. 创建一个新的虚拟设备或编辑现有的虚拟设备。

3. 在"System Image"选项卡中,选择一个带有Google APIs的映像。

4. 点击"Next"并完成虚拟设备的创建或编辑。

5. 运行项目时,选择使用此虚拟设备进行模拟器的启动。

这样,Firebase Instance ID服务将能够成功注册,并且不再出现"FireBaseInstanceId service does not get registered"的问题。

代码示例(在AVD Manager中选择Google APIs映像):

1. Open AVD Manager in Android Studio.
2. Create a new virtual device or edit an existing one.
3. In the "System Image" tab, select an image with Google APIs.
4. Click "Next" and complete the creation or editing of the virtual device.
5. When running the project, choose to launch the emulator using this virtual device.
By following these steps, the Firebase Instance ID service will be registered successfully, and the "FireBaseInstanceId service does not get registered" error will no longer occur.

0
0 Comments

问题:FireBaseInstanceId服务未注册的原因以及解决方法

如果您遵循了stackoverflow提供的解决方案,但仍然遇到相同的问题,请检查您是否在清单文件中添加了Internet权限。

<uses-permission android:name="android.permission.INTERNET"/>

有时,一些显而易见的东西会成为主要的罪魁祸首。

P.S:这个问题也发生在我身上。

0
0 Comments

问题的原因:FirebaseInstanceId服务没有注册

解决方法:确保Google Play服务可用

文章内容如下:

FirebaseInstanceId服务没有注册的原因可能是Google Play服务不可用。Firebase无法运行没有Google Play服务的情况下,因此我们需要检查是否安装了Google Play服务。

有用户反馈说他们已经安装了Google Play服务,但是FirebaseInstanceId服务仍然无法正常工作。这种情况下,我们需要确保Google Play服务已经正确安装并且在设备上可用。

如果你遇到了类似的问题,可以按照以下步骤来解决:

1. 打开设备的设置菜单,并找到"应用"或"应用管理器"选项。

2. 在应用列表中找到Google Play服务,并点击进入。

3. 检查Google Play服务的版本号,确保它是最新版本。如果不是最新版本,可以尝试更新它。

4. 如果Google Play服务已经是最新版本,可以尝试清除其缓存和数据。在应用信息页面中,点击"存储"选项,然后选择"清除缓存"和"清除数据"。

5. 重启设备,并再次检查FirebaseInstanceId服务是否正常工作。

如果上述步骤仍然无法解决问题,还可以尝试以下额外的解决方法:

1. 确保你的设备已经连接到互联网。有时候,FirebaseInstanceId服务需要从远程服务器获取数据。

2. 确保你的应用的build.gradle文件中有正确的依赖项。你可以参考Firebase文档中的指导来配置正确的依赖项。

3. 确保你的项目中已经添加了正确的google-services.json文件。你可以在Firebase控制台中下载该文件,并将其添加到你的项目中。

通过以上方法,希望能帮助你解决FirebaseInstanceId服务没有注册的问题。如果问题仍然存在,请尝试在Firebase官方论坛或Stack Overflow上寻求帮助。

0