我正尝试使用新的Google云消息传递系统,但我遇到了一些问题。com.google.android.gsf包无法找到
我阅读入门文档和审查演示应用程序;在那之后我实施的要求,我的应用程序,然后我创建了一个新的虚拟设备与API 16
但是当我尝试注册我的设备GCM,它失败,因为这行:
GCMRegistrar.checkDevice(getApplicationContext());
在logcat的我看到这些错误:
07-05 07:06:31.925: E/AndroidRuntime(691): FATAL EXCEPTION: main
07-05 07:06:31.925: E/AndroidRuntime(691): java.lang.UnsupportedOperationException: Device does not have package com.google.android.gsf
07-05 07:06:31.925: E/AndroidRuntime(691): at com.google.android.gcm.GCMRegistrar.checkDevice(GCMRegistrar.java:83)
07-05 07:06:31.925: E/AndroidRuntime(691): at aero.tav.mobile.genel$4.onClick(genel.java:201)
07-05 07:06:31.925: E/AndroidRuntime(691): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
07-05 07:06:31.925: E/AndroidRuntime(691): at android.os.Handler.dispatchMessage(Handler.java:99)
07-05 07:06:31.925: E/AndroidRuntime(691): at android.os.Looper.loop(Looper.java:137)
07-05 07:06:31.925: E/AndroidRuntime(691): at android.app.ActivityThread.main(ActivityThread.java:4745)
07-05 07:06:31.925: E/AndroidRuntime(691): at java.lang.reflect.Method.invokeNative(Native Method)
07-05 07:06:31.925: E/AndroidRuntime(691): at java.lang.reflect.Method.invoke(Method.java:511)
07-05 07:06:31.925: E/AndroidRuntime(691): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
07-05 07:06:31.925: E/AndroidRuntime(691): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-05 07:06:31.925: E/AndroidRuntime(691): at dalvik.system.NativeStart.main(Native Method)
我已经将gcm.jar添加到我的类路径;我不知道什么是错的。
你使用的是模拟器吗?如果是Google API模拟器?如果不是这是你的问题 – thepoosh
是的,我正在模拟器。 –
是Google API模拟器吗? – thepoosh