Android GCM SERVICE_NOT_AVAILABLE [英] Android GCM SERVICE_NOT_AVAILABLE

查看:236
本文介绍了Android GCM SERVICE_NOT_AVAILABLE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图设定这个例子:
https://code.google.com/p/gcm/source/browse/#git%2Fgcm-client
启动并运行。



根据指南,GoogleAPI项目已成功创建: http://developer.android.com/google/gcm/gs.html



但是,我有以下问题:在某些设备上我得到SERVICE_NOT_AVAILABLE无论什么。



W / System.err:java.io.IOException:SERVICE_NOT_AVAILABLE
W / System.err:com.google.android.gms.gcm.GoogleCloudMessaging一些统计资料:




  • Nexus 7,android 4.2.2:GCM示例完美运行

  • Nexus 4,Android 4.2:GCM示例完美运行

  • Nexus S,android 4.2.2:GCM示例三星Galaxy 3:SERVICE_NOT_AVAILABLE在100%的情况下

  • Samsung Galaxy,Android 2.3.6:SERVICE_NOT_AVAILABLE在100%的情况下

  • 摩托罗拉Xoom,Android 4.1.2:100%情况下的SERVICE_NOT_AVAILABLE

  • HTC Desire HD,Android 2.3:SERVICE_NOT_AVAILABLE在100%的情况下



它是相同的代码,相同的apk文件,各种谷歌帐户。我试图切换回GCMRegistrar方法,他们实际工作。所以问题是:是新的GCM方法在测试版?如何让他们在其他设备上工作,而不仅仅是纯粹的Google Android设备?



更新:其实我发现解决方案< a href =https://stackoverflow.com/a/17721385/1741459> here

解决方案

有时候这是由于GCM的时间顺序而发生的。请看看时间,如果是正确的。如果可能,然后重置。



还有两件事要检查,如果您使用的是模拟器,那么请确保您的模拟器上运行了google api。第二个gcm.jar包含在您的项目中。


I was trying to set this example: https://code.google.com/p/gcm/source/browse/#git%2Fgcm-client up and running.

The GoogleAPI project has been successfully created, according to the guide: http://developer.android.com/google/gcm/gs.html

However, I have the following problem: on some devices I get SERVICE_NOT_AVAILABLE no matter what.

W/System.err: java.io.IOException: SERVICE_NOT_AVAILABLE W/System.err: at com.google.android.gms.gcm.GoogleCloudMessaging.register(Unknown Source)

Some statistics:

  • Nexus 7, android 4.2.2: GCM example works perfectly
  • Nexus 4, android 4.2: GCM example works perfectly
  • Nexus S, android 4.2.2: GCM example works perfectly
  • Samsung Galaxy 3: SERVICE_NOT_AVAILABLE in 100% cases
  • Samsung Galaxy, android 2.3.6: SERVICE_NOT_AVAILABLE in 100% cases
  • Motorola Xoom, android 4.1.2: SERVICE_NOT_AVAILABLE in 100% cases
  • HTC Desire HD, android 2.3: SERVICE_NOT_AVAILABLE in 100% cases

It's the same code, the same apk file, various google accounts. I tried to switch back to GCMRegistrar methods and they actually work. So the question is: are new GCM methods in sort of beta? How to make them work on other devices, not just 'pure' Google Android devices?

Update: In fact, I found the solution here

解决方案

Sometimes it happened due to time syn with GCM. Please have a look at the time, if it is correct. If possible then reset.

Two more thing to check, if you are using a emulator then please make sure that you have the google api running on the emulator. and second gcm.jar is included on your project.

这篇关于Android GCM SERVICE_NOT_AVAILABLE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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