java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.GCMReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

Appcelerator JIRA | Swapnil Singh | 11 months ago
  1. 0

    h6.Issue Description While sending push notifications from aws dashboard or my api, android doesnt detect any payload received. And if the application is in background the application crashes with the following stacktrace: {code} [ERROR] : APSCloudPush: Payload is null! [ERROR] : TiApplication: (main) [727118,839001] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.GCMReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference; Titanium 5.2.0,2015/11/25 11:26,1edba8d [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.GCMReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference [ERROR] : TiApplication: at android.app.ActivityThread.handleReceiver(ActivityThread.java:2776) [ERROR] : TiApplication: at android.app.ActivityThread.-wrap14(ActivityThread.java) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5466) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) [ERROR] : TiApplication: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference [ERROR] : TiApplication: at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:116) [ERROR] : TiApplication: at org.json.JSONTokener.nextValue(JSONTokener.java:94) [ERROR] : TiApplication: at org.json.JSONObject.<init>(JSONObject.java:156) [ERROR] : TiApplication: at org.json.JSONObject.<init>(JSONObject.java:173) [ERROR] : TiApplication: at com.appcelerator.aps.APSCloudPush.showTrayNotification(APSCloudPush.java:347) [ERROR] : TiApplication: at com.appcelerator.aps.APSCloudPush.receivePayload(APSCloudPush.java:253) [ERROR] : TiApplication: at com.appcelerator.aps.GCMReceiver.onReceive(GCMReceiver.java:30) [ERROR] : TiApplication: at android.app.ActivityThread.handleReceiver(ActivityThread.java:2769) [ERROR] : TiApplication: ... 8 more {code} h6.Information we tried the following structure for sending notifications: Suggested By Appcelerator but not working {code} "data":{ "payload":{ "android": { "alert": "This is a message from my own server" } } } {code} h6.AWS DEFAULT BUT NOT WORKING: {code} { "default": "Welcome", "GCM": "{ \"data\": { \"message\": \"Welcome\" } }" } {code} h6.WORKING ONE But when we tried this, if app is in foreground it shows the message, but in background it crashes again : {code} { "default": "Welcome", "GCM": "{ \"data\": { \"payload\": \"Welcome\" } }" } {code}

    Appcelerator JIRA | 11 months ago | Swapnil Singh
    java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.GCMReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
  2. 0

    h6.Issue Description While sending push notifications from aws dashboard or my api, android doesnt detect any payload received. And if the application is in background the application crashes with the following stacktrace: {code} [ERROR] : APSCloudPush: Payload is null! [ERROR] : TiApplication: (main) [727118,839001] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.GCMReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference; Titanium 5.2.0,2015/11/25 11:26,1edba8d [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.GCMReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference [ERROR] : TiApplication: at android.app.ActivityThread.handleReceiver(ActivityThread.java:2776) [ERROR] : TiApplication: at android.app.ActivityThread.-wrap14(ActivityThread.java) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5466) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) [ERROR] : TiApplication: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference [ERROR] : TiApplication: at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:116) [ERROR] : TiApplication: at org.json.JSONTokener.nextValue(JSONTokener.java:94) [ERROR] : TiApplication: at org.json.JSONObject.<init>(JSONObject.java:156) [ERROR] : TiApplication: at org.json.JSONObject.<init>(JSONObject.java:173) [ERROR] : TiApplication: at com.appcelerator.aps.APSCloudPush.showTrayNotification(APSCloudPush.java:347) [ERROR] : TiApplication: at com.appcelerator.aps.APSCloudPush.receivePayload(APSCloudPush.java:253) [ERROR] : TiApplication: at com.appcelerator.aps.GCMReceiver.onReceive(GCMReceiver.java:30) [ERROR] : TiApplication: at android.app.ActivityThread.handleReceiver(ActivityThread.java:2769) [ERROR] : TiApplication: ... 8 more {code} h6.Information we tried the following structure for sending notifications: Suggested By Appcelerator but not working {code} "data":{ "payload":{ "android": { "alert": "This is a message from my own server" } } } {code} h6.AWS DEFAULT BUT NOT WORKING: {code} { "default": "Welcome", "GCM": "{ \"data\": { \"message\": \"Welcome\" } }" } {code} h6.WORKING ONE But when we tried this, if app is in foreground it shows the message, but in background it crashes again : {code} { "default": "Welcome", "GCM": "{ \"data\": { \"payload\": \"Welcome\" } }" } {code}

    Appcelerator JIRA | 11 months ago | Swapnil Singh
    java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.GCMReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
  3. 0

    multi user gallery exception on 3.0.1

    GitHub | 11 months ago | c3ph3us
    java.lang.RuntimeException: Unable to start receiver org.codeaurora.gallery3d.video.DmReceiver: java.lang.SecurityException: get package info: Neither user 1110039 nor current process has android.permission.INTERACT_ACROSS_USERS.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    permissions for changing system settings gallery2 on cm13

    GitHub | 11 months ago | c3ph3us
    java.lang.RuntimeException: Unable to start receiver org.codeaurora.gallery3d.video.DmReceiver: java.lang.SecurityException: com.android.gallery3d was not granted this permission: android.permission.WRITE_SETTINGS.
  6. 0

    exception when second user is changed on 3.0.1

    GitHub | 11 months ago | c3ph3us
    java.lang.RuntimeException: Unable to start receiver com.android.launcher3.ThemeChangedReceiver: java.lang.IllegalStateException: LauncherAppState inited before app context set

  1. iridic 1 times, last 3 weeks ago
  2. VeryRedChris 3 times, last 4 weeks ago
  3. ajinkya_w 34 times, last 2 months ago
  4. Ajeet 10 times, last 3 months ago
  5. Bassiuz 9 times, last 5 months ago
7 more registered users
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.RuntimeException

    Unable to start receiver com.appcelerator.aps.GCMReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

    at android.app.ActivityThread.handleReceiver()
  2. Android Platform
    ActivityThread.handleReceiver
    1. android.app.ActivityThread.handleReceiver(ActivityThread.java:2776)
    1 frame