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

Rotating the Android device causes any Qt application to crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 FF
    • 6.7.0
    • Quick: Layouts
    • None
    • Android
    • d6861926a (dev)
    • 2023wk46FOQtforAndroid

    Description

      MacOS 14.1

      Qt Creator 12.0.0-rc1 (11.0.84)

      Device: Samsung Galaxy S22 13.0 / Samsung Galaxy S9 9.0

      Qt Version:

      Qt 6.7.0 
      2023-11-13
      sha1: eadc7461ca268e97d9cec885cee9c5a59cc365f8

      Steps to reproduce:

      1. Create a new application or open an existing example, e.g. gallery quick controls example
      2. Run the app on an Android device.
      3. Rotate the device from portrait to landscape.

      Expected: The app rotates and works without any problems.

      Actual: The app crashes. 

      On Android 9 the app works until I rotate the screen. On Android 13 it crashed without rotating the device few seconds after launch. 

      Reproducibility:  100%

       

      E AndroidRuntime: FATAL EXCEPTION: main
      E AndroidRuntime: Process: org.qtproject.example.appuntitled2, PID: 9942
      E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.qtproject.qt.android.QtLayout.setActivityDisplayRotation(int)' on a null object reference
      E AndroidRuntime:     at org.qtproject.qt.android.QtDisplayManager$1.onDisplayChanged(QtDisplayManager.java:80)
      E AndroidRuntime:     at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage(DisplayManagerGlobal.java:1652)
      E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:106)
      E AndroidRuntime:     at android.os.Looper.loopOnce(Looper.java:226)
      E AndroidRuntime:     at android.os.Looper.loop(Looper.java:313)
      E AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:8741)
      E AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
      E AndroidRuntime:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
      E AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) 

       

      Attachments

        Issue Links

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

          Activity

            People

              assam Assam Boudjelthia
              lkos Łukasz Kosiorowski
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes