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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.15.12
    • Extras: Android
    • None
    • Android
    • 2024wk18FOQtforAndroid

    Description

      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

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes