Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.15
-
-
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
Issue Links
- relates to
-
QTBUG-112816 REG [6.5.0->6.5.1] corelib/platform/androidnotifier not compiling on Android
- Closed
For Gerrit Dashboard: QTBUG-98073 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
380542,3 | NFC: Fix PendingIntent creation for Android 12 | dev | qt/qtconnectivity | Status: MERGED | +2 | 0 |
381206,2 | NFC: Fix PendingIntent creation for Android 12 | 6.2 | qt/qtconnectivity | Status: MERGED | +2 | 0 |
381307,3 | NFC: Fix PendingIntent creation for Android 12 | tqtc/lts-5.15 | qt/tqtc-qtconnectivity | Status: MERGED | +2 | 0 |