Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23333

Android: Attempt to invoke virtual method 'void android.view.OrientationEventListener.disable()' on a null object reference Crash

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 5.2.2
    • Fix Version/s: Release 6.0.0
    • Component/s: Android
    • Labels:
      None
    • Environment:

      Android

    • Story Points:
      2
    • Sprint:
      2016 Sprint 12 SDK

      Description

      We get the following crash frequently:

      java.lang.RuntimeException: Unable to destroy activity

      {com.myapp/org.appcelerator.titanium.TiActivity}

      : java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.OrientationEventListener.disable()' on a null object reference
      at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3821)
      at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3839)
      at android.app.ActivityThread.access$1400(ActivityThread.java:162)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1403)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5431)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
      Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.OrientationEventListener.disable()' on a null object reference
      at org.appcelerator.titanium.TiBaseActivity.onDestroy(TiBaseActivity.java:1477)
      at org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:29)
      at android.app.Activity.performDestroy(Activity.java:6235)
      at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1141)
      at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3808)
      ... 10 more

      It is happening when android os terminates app to save memory at onDestroy method. (This happens quite a lot since our users usually keep app open for long periods) This is not happening at 4.0 sdk (we got those after upgrading from 4.0 to 5.2.2)

      After searching changes history this change seems to have caused this behavior :

      https://github.com/appcelerator/titanium_mobile/commit/2b12ad61775920f8045e168ae678ce123dfa14b4 seems to have caused the issue

        Attachments

          Activity

            People

            • Assignee:
              hpham Hieu Pham
              Reporter:
              peaceofmind7 john adamis
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-9711
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code