Bluemix: Failed to run Android Hello Push app

203 views Asked by At

I'm trying to run sample app for Bluemix Mobile Services https://github.com/ibm-bluemix-mobile-services/bms-samples-android-hellopush/blob/master/helloPush/app/src/main/AndroidManifest.xml

Pushing Register Button I got:

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

Any ideas?

1

There are 1 answers

0
James Young IBM On BEST ANSWER

So the sample works on a physical device and was not working on a Genymotion virtual device. As such I would suspect that Google Apps haven't been installed into the virtual device and as such it is unable to register for and receive push notifications from GCM.

If you would like to look at installing GApps onto your Genymotion emulator I would suggest checking out this SO question How do you install Google frameworks (Play, Accounts, etc.) on a Genymotion virtual device?

Regards