Android:FCM java.io.IOException:某些设备上的 SERVICE_NOT_AVAILABLE 错误 [英] Android: FCM java.io.IOException: SERVICE_NOT_AVAILABLE error on some devices

查看:59
本文介绍了Android:FCM java.io.IOException:某些设备上的 SERVICE_NOT_AVAILABLE 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用 FCM

它可以在 Sony xperia、Galaxy S6、摩托罗拉等设备上正常工作.但是在 Galaxy S3 上我得到 java.io.IOException: SERVICE_NOT_AVAILABLE 错误

It work correct on Sony xperia, Galaxy S6, Motorola and more. But on Galaxy S3 i get java.io.IOException: SERVICE_NOT_AVAILABLE error

Galaxy S3 自动计时,google play 更新

Time of Galaxy S3 is auto and google play is updated

互联网连接很好,我连接到没有代理的开放互联网

Internet connection is strong and i connected to open internet without proxy

推荐答案

当设备无法注册到 Firebase 时会出现此错误.确保调用此代码时互联网正常工作.并将代码放入 try-catch 以防止应用崩溃.

This error is caused when the device is unable to register to Firebase. Make sure the internet is working when this code is called. And put the code within try-catch to stop app from crashing.

在注册设备或获取令牌之前添加互联网连接检查.或者将 Fetch 令牌代码包装在 try-catch 块中,以防止应用崩溃.

Either add an internet connection check before registering the device or fetching token. Or wrap the Fetch token code in try-catch block to prevent app from crashing.

这篇关于Android:FCM java.io.IOException:某些设备上的 SERVICE_NOT_AVAILABLE 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆