Bluemix:无法运行Android Hello Push应用程序

时间:2016-02-15 14:08:38

标签: ibm-cloud ibm-mobile-services

我正在尝试为Bluemix Mobile Services运行示例应用https://github.com/ibm-bluemix-mobile-services/bms-samples-android-hellopush/blob/master/helloPush/app/src/main/AndroidManifest.xml

推送注册按钮我得到了:

02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime: Process: com.ibm.hellopush, PID: 15455
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime: java.lang.RuntimeException: An error occured while executing doInBackground()
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at android.os.AsyncTask$3.done(AsyncTask.java:300)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.lang.Thread.run(Thread.java:841)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:  Caused by: java.lang.NullPointerException
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at com.google.android.gms.gcm.GoogleCloudMessaging.register(Unknown Source)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush$6.doInBackground(MFPPush.java:549)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush$6.doInBackground(MFPPush.java:541)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at android.os.AsyncTask$2.call(AsyncTask.java:288)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime:     at java.lang.Thread.run(Thread.java:841) 
02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler: Logger$UncaughtExceptionHandler.uncaughtException in Logger.java:316 :: Uncaught Exception
02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler: java.lang.RuntimeException: An error occured while executing doInBackground()
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at android.os.AsyncTask$3.done(AsyncTask.java:300)
02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.lang.Thread.run(Thread.java:841)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:  Caused by: java.lang.NullPointerException
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at com.google.android.gms.gcm.GoogleCloudMessaging.register(Unknown Source)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush$6.doInBackground(MFPPush.java:549)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at com.ibm.mobilefirstplatform.clientsdk.android.push.api.MFPPush$6.doInBackground(MFPPush.java:541)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at android.os.AsyncTask$2.call(AsyncTask.java:288)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
 02-15 08:58:52.854 15455-15475/com.ibm.hellopush E/com.ibm.mobilefirstplatform.clientsdk.android.logger.api.Logger$UncaughtExceptionHandler:     at java.lang.Thread.run(Thread.java:841) 
02-15 08:58:52.854 533-660/system_process D/: HostConnection::get() New Host Connection established 0xb940dfb8, tid 660

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

因此,该示例可在物理设备上运行,而无法在Genymotion虚拟设备上运行。因此,我怀疑Google Apps尚未安装到虚拟设备中,因此无法注册并接收来自GCM的推送通知。

如果您想在您的Genymotion模拟器上安装GApps,我建议您查看这个问题 How do you install Google frameworks (Play, Accounts, etc.) on a Genymotion virtual device?

此致