在Genymotion上运行应用程序时遇到一个小问题。我目前正在为绿色家伙完成UI,并在激活云推送模块时遇到问题。
我得到的错误如下。
[ERROR] : TiApplication: (main) [36,275] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.PushBroadcastReceiver: java.lang.NullPointerException: PushType is NONE!; Titanium 5.1.2,2015/12/16 19:00,ca822b2
[ERROR] : TiApplication: java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.PushBroadcastReceiver: java.lang.NullPointerException: PushType is NONE!
[ERROR] : TiApplication: at android.app.ActivityThread.handleReceiver(ActivityThread.java:2236)
[ERROR] : TiApplication: at android.app.ActivityThread.access$1500(ActivityThread.java:130)
[ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
[ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:99)
[ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:137)
[ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:4745)
[ERROR] : TiApplication: at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:511)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
[ERROR] : TiApplication: at dalvik.system.NativeStart.main(Native Method)
[ERROR] : TiApplication: Caused by: java.lang.NullPointerException: PushType is NONE!
[ERROR] : TiApplication: at com.appcelerator.aps.CCPushService.ifEnabled(CCPushService.java:256)
[ERROR] : TiApplication: at com.appcelerator.aps.PushBroadcastReceiver.onReceive(PushBroadcastReceiver.java:59)
[ERROR] : TiApplication: at android.app.ActivityThread.handleReceiver(ActivityThread.java:2229)
[ERROR] : TiApplication: ... 10 more
运行SDK 5.1.2GA并在tiapp.xml文件中包含相关的XML属性。我已在Google Developer Console中设置了密钥,并将这些详细信息输入到Appcelerator Platform Web门户中。
我有点坚持这个。这是因为我在模拟器上运行吗?或者我错过了什么,只是有另一个开发者时刻。
提前致谢。
史蒂夫
答案 0 :(得分:0)
Genymotion模拟器do not come with Google Apps需要推送通知(通过GCM)。
请Google了解如何在Genymotion模拟器上安装Google Apps,或者只使用Android模拟器(AVD)。最近的那些实际上非常快。
同样请参阅this blog post。