Bluemix:无法 运行 Android Hello Push 应用程序
Bluemix: Failed to run Android Hello Push app
我正在尝试 运行 Bluemix 移动服务的示例应用程序 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.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.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.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.doInBackground(MFPPush.java:541)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime: at android.os.AsyncTask.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.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.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.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.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.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.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.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
有什么想法吗?
所以示例在物理设备上运行,而不是在 Genymotion 虚拟设备上运行。因此,我怀疑 Google 应用程序尚未安装到虚拟设备中,因此它无法注册和接收来自 GCM 的推送通知。
如果您想将 GApps 安装到您的 Genymotion 模拟器上,我建议您查看这个 SO 问题
How do you install Google frameworks (Play, Accounts, etc.) on a Genymotion virtual device?
此致
我正在尝试 运行 Bluemix 移动服务的示例应用程序 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.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.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.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.doInBackground(MFPPush.java:541)
02-15 08:58:52.850 15455-15795/com.ibm.hellopush E/AndroidRuntime: at android.os.AsyncTask.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.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.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.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.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.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.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.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
有什么想法吗?
所以示例在物理设备上运行,而不是在 Genymotion 虚拟设备上运行。因此,我怀疑 Google 应用程序尚未安装到虚拟设备中,因此它无法注册和接收来自 GCM 的推送通知。
如果您想将 GApps 安装到您的 Genymotion 模拟器上,我建议您查看这个 SO 问题 How do you install Google frameworks (Play, Accounts, etc.) on a Genymotion virtual device?
此致