java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference

Appcelerator JIRA | Tim Poulsen | 1 year ago
  1. 0

    Creating a separate ticket for my comments on TIMOB-18098. PR https://github.com/appcelerator/titanium_mobile/pull/6958 Our app crashes frequently when the it's woken from the background by the user tapping a push notification. We are using the http://iamyellow.net/post/40100981563/gcm-appcelerator-titanium-module GCM module. {code} 06-30 14:06:51.234: W/System.err(19120): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.titanium.proxy.IntentProxy.putExtra(IntentProxy.java:198) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:177) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:299) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:203) 06-30 14:06:51.234: W/System.err(19120): at android.os.Handler.dispatchMessage(Handler.java:98) 06-30 14:06:51.234: W/System.err(19120): at android.os.Looper.loop(Looper.java:145) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) {code} If the app is open when the message arrives, it is received and handled fine. If the app is in the background, we see the above in the adb logs. I have tried with 3.5.0.GA, 3.5.1.GA, 4.0.0.GA, and a nightly I built myself (don't recall the date of that build, but post GA). Tested on both Android 5.0 and 4.2.2 devices. I have found that a simple null value check in the putExtra() method resolves this issue. {code} @Kroll.method public void putExtra(String key, Object value) { if (value == null) { return; } ... {code} https://github.com/appcelerator/titanium_mobile/pull/6958 (master) https://github.com/appcelerator/titanium_mobile/pull/6957 (3_5_X)

    Appcelerator JIRA | 1 year ago | Tim Poulsen
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
  2. 0

    Creating a separate ticket for my comments on TIMOB-18098. PR https://github.com/appcelerator/titanium_mobile/pull/6958 Our app crashes frequently when the it's woken from the background by the user tapping a push notification. We are using the http://iamyellow.net/post/40100981563/gcm-appcelerator-titanium-module GCM module. {code} 06-30 14:06:51.234: W/System.err(19120): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.titanium.proxy.IntentProxy.putExtra(IntentProxy.java:198) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:177) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:299) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:203) 06-30 14:06:51.234: W/System.err(19120): at android.os.Handler.dispatchMessage(Handler.java:98) 06-30 14:06:51.234: W/System.err(19120): at android.os.Looper.loop(Looper.java:145) 06-30 14:06:51.234: W/System.err(19120): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) {code} If the app is open when the message arrives, it is received and handled fine. If the app is in the background, we see the above in the adb logs. I have tried with 3.5.0.GA, 3.5.1.GA, 4.0.0.GA, and a nightly I built myself (don't recall the date of that build, but post GA). Tested on both Android 5.0 and 4.2.2 devices. I have found that a simple null value check in the putExtra() method resolves this issue. {code} @Kroll.method public void putExtra(String key, Object value) { if (value == null) { return; } ... {code} https://github.com/appcelerator/titanium_mobile/pull/6958 (master) https://github.com/appcelerator/titanium_mobile/pull/6957 (3_5_X)

    Appcelerator JIRA | 1 year ago | Tim Poulsen
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
  3. 0

    support.v7.app.AlertDialog throws NullPointerException on dismiss

    Stack Overflow | 2 years ago
    java.lang.NullPointerException: attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.lang.NullPointerException in getPushEventListener - Pushwoosh Community

    pushwoosh.com | 3 months ago
    java.lang.RuntimeException: Error receiving broadcast Intent { act=fr.mandark.www.com.arellomobile.android.push.REGISTER_BROAD_CAST_ACTION flg=0x10 pkg=fr.mandark.www (has extras) } in com.arellomobile.android.push.fragment.PushFragment$1@5c7df2c
  6. 0

    NPE in recordEvent (Android) - Android - New Relic Online Technical Community

    newrelic.com | 3 months ago
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference

    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 'java.lang.Class java.lang.Object.getClass()' on a null object reference

      at org.appcelerator.titanium.proxy.IntentProxy.putExtra()
    2. org.appcelerator.titanium
      IntentProxy.putExtra
      1. org.appcelerator.titanium.proxy.IntentProxy.putExtra(IntentProxy.java:198)
      1 frame
    3. org.appcelerator.kroll
      V8Runtime.handleMessage
      1. org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
      2. org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:177)
      3. org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:299)
      4. org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:203)
      4 frames
    4. Android Platform
      Looper.loop
      1. android.os.Handler.dispatchMessage(Handler.java:98)
      2. android.os.Looper.loop(Looper.java:145)
      2 frames
    5. org.appcelerator.kroll
      KrollRuntime$KrollRuntimeThread.run
      1. org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
      1 frame