Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111960

NPE: Attempt to invoke virtual method setActivityDisplayRotation() on a null object reference

XMLWordPrintable

    • Android
    • 33ff8f93a (tqtc/lts-5.15), bf4825b31 (tqtc/lts-6.5), 6ef5ac9e0 (tqtc/lts-6.2)
    • 2024wk18FOQtforAndroid

      We recently upgraded from Qt 5.15.2 to 5.15.12 and are now seeing crashes like the following:

      Exception java.lang.NullPointerException: Attempt to invoke virtual method 'void org.qtproject.qt5.android.QtLayout.setActivityDisplayRotation(int)' on a null object reference
        at org.qtproject.qt5.android.QtActivityDelegate$4.onDisplayChanged (QtActivityDelegate.java:603)
        at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage (DisplayManagerGlobal.java:736)
        at android.os.Handler.dispatchMessage (Handler.java:106)
        at android.os.Looper.loop (Looper.java:268)
        at android.app.ActivityThread.main (ActivityThread.java:8023)
        at java.lang.reflect.Method.invoke
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:635)
        at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:947)

      From the lifecycle events in Sentry we can see that this seems to happen when the app is either resumed from background or moved to background.

      Affected OS versions include Android 8–13.

      Affected devices include the following:

      • TECNO SPARK 7P
      • TECNO KG5k
      • POCO M3
      • Redmi Note 8 pro
      • realme 8
      • POCO X3 Pro
      • Pixel 7 Pro

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ahmedelkhazari Ahmed El Khazari
            fseiffert Frederik Seiffert
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes