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

cork board example crashes on android 12 device when targetSDK set to 31

    XMLWordPrintable

Details

    • Android
    • 3753c53fc810c292db93fcfbafffbc097afb0ed1 (qt/qtconnectivity/dev) 95f1dd2f67f02c5a774e022c465e3ac4f7f9ffef (qt/qtconnectivity/6.2) 3ec991f35e0e7450c9fdc64abea4e502f44605c4 (qt/tqtc-qtconnectivity/5.15)

    Description

      <QtIntallation>Examples\<QtVersion>\nfc\corkboard

      The above example crashes on android 12 devices when target SDK set to 31. It does not crash when target SDK is set to 30. Also it does not crash on emulator.

      The crash stack:

      2021-11-08 12:20:23.226 25176-25176/org.qtproject.example E/AndroidRuntime: FATAL EXCEPTION: main
      Process: org.qtproject.example, PID: 25176
      java.lang.NullPointerException
      at android.nfc.NfcAdapter.enableForegroundDispatch(NfcAdapter.java:1583)
      at org.qtproject.qt5.android.nfc.QtNfc$1.run(QtNfc.java:137)
      at android.os.Handler.handleCallback(Handler.java:938)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loopOnce(Looper.java:201)
      at android.os.Looper.loop(Looper.java:288)
      at android.app.ActivityThread.main(ActivityThread.java:7842)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

      Some other application output probably relevant:

      11-08 12:34:16.334 26940 26940 W System.err: Caused by: java.lang.IllegalArgumentException: org.qtproject.example: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
      11-08 12:34:16.334 26940 26940 W System.err: Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
      11-08 12:34:16.334 26940 26940 W System.err: at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
      11-08 12:34:16.334 26940 26940 W System.err: at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
      11-08 12:34:16.334 26940 26940 W System.err: at android.app.PendingIntent.getActivity(PendingIntent.java:444)
      11-08 12:34:16.334 26940 26940 W System.err: at android.app.PendingIntent.getActivity(PendingIntent.java:408)
      11-08 12:34:16.335 26940 26940 W System.err: at org.qtproject.qt5.android.nfc.QtNfc.setContext(QtNfc.java:85)

      Attachments

        Activity

          People

            ivan.solovev Ivan Solovev
            yifei Yi Fei (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: