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 | Shawn Lan | 1 year ago
  1. 0

    APS Cloud Push - Payload is null

    Stack Overflow | 1 year ago | Shawn
    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

    APS CloudPush - Payload is null! | Community Q&A

    appcelerator.com | 1 year ago
    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

    My app uses android push notification. If I do a fresh install on my android phone, I get the following error. It behaves as if a push notification is coming in, but there is actually none. {code} [ERROR] : APSCloudPush: Payload is null! [ERROR] : TiApplication: (main) [4889,4889] 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 4.0.0,2015/05/18 15:42,9239ff9 [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:2726) [ERROR] : TiApplication: at android.app.ActivityThread.access$1700(ActivityThread.java:144) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:155) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5696) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:372) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028) [ERROR] : TiApplication: [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:2712) [ERROR] : TiApplication: ... 9 more {code} Here is the js code: {code} var CloudPush = require('ti.cloudpush'); var rc = CloudPush.isGooglePlayServicesAvailable(); if(rc == CloudPush.SUCCESS){ var flagBgPush = function(){ bgPush = true; }; CloudPush.retrieveDeviceToken({ success: deviceTokenSuccess, error: function(){} }); CloudPush.addEventListener('trayClickLaunchedApp', flagBgPush); CloudPush.addEventListener('trayClickFocusedApp', flagBgPush); CloudPush.addEventListener('callback', pushBackgroundCheck); } {code}

    Appcelerator JIRA | 1 year ago | Shawn Lan
    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
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    My app uses android push notification. If I do a fresh install on my android phone, I get the following error. It behaves as if a push notification is coming in, but there is actually none. {code} [ERROR] : APSCloudPush: Payload is null! [ERROR] : TiApplication: (main) [4889,4889] 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 4.0.0,2015/05/18 15:42,9239ff9 [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:2726) [ERROR] : TiApplication: at android.app.ActivityThread.access$1700(ActivityThread.java:144) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:155) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5696) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:372) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028) [ERROR] : TiApplication: [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:2712) [ERROR] : TiApplication: ... 9 more {code} Here is the js code: {code} var CloudPush = require('ti.cloudpush'); var rc = CloudPush.isGooglePlayServicesAvailable(); if(rc == CloudPush.SUCCESS){ var flagBgPush = function(){ bgPush = true; }; CloudPush.retrieveDeviceToken({ success: deviceTokenSuccess, error: function(){} }); CloudPush.addEventListener('trayClickLaunchedApp', flagBgPush); CloudPush.addEventListener('trayClickFocusedApp', flagBgPush); CloudPush.addEventListener('callback', pushBackgroundCheck); } {code}

    Appcelerator JIRA | 1 year ago | Shawn Lan
    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
  6. 0

    Image not uploading into server and app crashes

    Stack Overflow | 2 years ago
    java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

  1. gaurav 38 times, last 2 weeks ago
  2. pranavprakash 17 times, last 1 month ago
  3. ajinkya_w 74 times, last 2 months ago
  4. ajinkya_w 351 times, last 2 months ago
  5. Akshay 4 times, last 3 months ago
5 more registered users
7 unregistered visitors
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.NullPointerException

    Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

    at org.json.JSONTokener.nextCleanInternal()
  2. Android Platform
    JSONObject.<init>
    1. org.json.JSONTokener.nextCleanInternal(JSONTokener.java:116)
    2. org.json.JSONTokener.nextValue(JSONTokener.java:94)
    3. org.json.JSONObject.<init>(JSONObject.java:156)
    4. org.json.JSONObject.<init>(JSONObject.java:173)
    4 frames
  3. com.appcelerator.aps
    GCMReceiver.onReceive
    1. com.appcelerator.aps.APSCloudPush.showTrayNotification(APSCloudPush.java:347)
    2. com.appcelerator.aps.APSCloudPush.receivePayload(APSCloudPush.java:253)
    3. com.appcelerator.aps.GCMReceiver.onReceive(GCMReceiver.java:30)
    3 frames
  4. Android Platform
    ActivityThread.main
    1. android.app.ActivityThread.handleReceiver(ActivityThread.java:2712)
    2. android.app.ActivityThread.handleReceiver(ActivityThread.java:2726)
    3. android.app.ActivityThread.access$1700(ActivityThread.java:144)
    4. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1449)
    5. android.os.Handler.dispatchMessage(Handler.java:102)
    6. android.os.Looper.loop(Looper.java:155)
    7. android.app.ActivityThread.main(ActivityThread.java:5696)
    7 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:372)
    2 frames
  6. Android
    ZygoteInit$MethodAndArgsCaller.run
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
    1 frame