Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crash when notification tapped #1

Closed
skypanther opened this issue Jun 15, 2016 · 1 comment
Closed

App crash when notification tapped #1

skypanther opened this issue Jun 15, 2016 · 1 comment

Comments

@skypanther
Copy link

I'm trying to replace our existing GCM module (the morinel module) with yours. Your module looks good, but I get occasional app crashes after a user taps a notification. And, I'm seeing errors in the console that I suppose might be related.

Scenario where this just happened:

  1. I uninstalled my app to remove all registered services, etc.
  2. With ti.goosh now integrated, I build & install the app to my device
  3. I opened the app once to register the services, register for push & save the token, etc. Then I exited the app (with the back button)
  4. I send a test push.
  5. I tap the notification and my app comes to the foreground but the "Sorry, APPNAME has crashed" alert is shown. I tap OK and my app continues to load. I think what is happening is that the old app instance is being killed because I see that our app_destroy handler is being called. This is perhaps a case of you using the wrong launch intent type.

I also see the following in the console logs, which may be a separate issue:

[ERROR] TiApplication: (AsyncTask #2) [191744,195672] Sending event: exception on thread: AsyncTask #2 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.gson.JsonPrimitive com.google.gson.JsonObject.getAsJsonPrimitive(java.lang.String)' on a null object reference; Titanium 5.2.2,2016/03/28 14:12,b685ddb
[ERROR] TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.gson.JsonPrimitive com.google.gson.JsonObject.getAsJsonPrimitive(java.lang.String)' on a null object reference
[ERROR] TiApplication:  at ti.goosh.IntentService.parseNotification(IntentService.java:130)
[ERROR] TiApplication:  at ti.goosh.IntentService.onMessageReceived(IntentService.java:47)
[ERROR] TiApplication:  at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source)
[ERROR] TiApplication:  at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source)
[ERROR] TiApplication:  at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
[ERROR] TiApplication:  at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
[ERROR] TiApplication:  at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
[ERROR] TiApplication:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
[ERROR] TiApplication:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
[ERROR] TiApplication:  at java.lang.Thread.run(Thread.java:818)
[ERROR] AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
[ERROR] AndroidRuntime: Process: com.acvauctions.demo, PID: 27557
[ERROR] AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.gson.JsonPrimitive com.google.gson.JsonObject.getAsJsonPrimitive(java.lang.String)' on a null object reference
[ERROR] AndroidRuntime:     at ti.goosh.IntentService.parseNotification(IntentService.java:130)
[ERROR] AndroidRuntime:     at ti.goosh.IntentService.onMessageReceived(IntentService.java:47)
[ERROR] AndroidRuntime:     at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source)
[ERROR] AndroidRuntime:     at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source)
[ERROR] AndroidRuntime:     at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source)
[ERROR] AndroidRuntime:     at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source)
[ERROR] AndroidRuntime:     at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source)
[ERROR] AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
[ERROR] AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
[ERROR] AndroidRuntime:     at java.lang.Thread.run(Thread.java:818)
[INFO]  Process: Sending signal. PID: 27557 SIG: 9
@kopiro
Copy link
Contributor

kopiro commented Jun 20, 2016

Solved!
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants