0
votes

I've followed the wizard to produce an 'app engine connected android project' and using instructions from https://developers.google.com/eclipse/docs/endpoints-androidconnected-gae.

The only additions I have made to what is auto-generated are setting the api key, setting process number, setting LOCAL_ANDROID_RUN to true.

Appengine dev server starts fine and all as it should be on localhost:8888

Android app deploys fine to emulator (running google apis as target).

But when I click to register I get

'Sorry! The application VillageTest (process com.villagetest) has stopped unexpectedly. Please try again.'

with a button to 'force close'.

Logcat is as follows:

03-27 16:19:02.098: D/dalvikvm(422): GC_FOR_MALLOC freed 5074 objects / 389216 bytes in 75ms
03-27 16:19:02.288: V/GCMBaseIntentService(422): Releasing wakelock
03-27 16:19:02.288: W/dalvikvm(422): threadid=9: thread exiting with uncaught exception (group=0x4001d800)
03-27 16:19:02.298: E/AndroidRuntime(422): FATAL EXCEPTION: IntentService[GCMIntentService-405986951973-1]
03-27 16:19:02.298: E/AndroidRuntime(422): java.lang.NullPointerException
03-27 16:19:02.298: E/AndroidRuntime(422):  at com.villagetest.GCMIntentService.onRegistered(GCMIntentService.java:144)
03-27 16:19:02.298: E/AndroidRuntime(422):  at com.google.android.gcm.GCMBaseIntentService.handleRegistration(GCMBaseIntentService.java:251)
03-27 16:19:02.298: E/AndroidRuntime(422):  at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:153)
03-27 16:19:02.298: E/AndroidRuntime(422):  at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
03-27 16:19:02.298: E/AndroidRuntime(422):  at android.os.Handler.dispatchMessage(Handler.java:99)
03-27 16:19:02.298: E/AndroidRuntime(422):  at android.os.Looper.loop(Looper.java:123)
03-27 16:19:02.298: E/AndroidRuntime(422):  at android.os.HandlerThread.run(HandlerThread.java:60)

Please help. It's driving me crazy!!

2
You should include the code that causes the NullPointerException if you want to get any help. - Eran

2 Answers

0
votes

The problem appears to be in your implementation of GCMIntentService (at GCMIntentService.java line 144). I suggest you post or look at that line in your code.

Have you followed the instructions for implementing GCM in your app:
http://developer.android.com/google/gcm/gs.html
Most specifically, Step 3?

Also, note that someone else posted almost exactly the same question yesterday...
app engine(eclipse): can't register device from android emulator to endpoint

You appear to be experiencing the exact same problem and he has now posted his line 144. I'm going to follow up there.

0
votes

This is fixed in the latest version of GPE (3.2.2) released today. The problem had to do with a missing null check in the case where you'd never registered your device with the endpoint before.