Scanner broken when targeting Android 12+
See original GitHub issueThis looks to be preventing us from targeting 12 at the moment.
java.lang.IllegalArgumentException: co.dance.rider: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
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.
at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
at no.nordicsemi.android.support.v18.scanner.BluetoothLeScannerImplOreo.createStartingPendingIntent(BluetoothLeScannerImplOreo.java:171)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Behavior changes: Apps targeting Android 12
Learn about changes in Android 12 that will affect apps when they target ... Android 12 makes all notifications visually consistent and easy...
Read more >When I install my application again then show Apps targeting ...
Since your application is targeting Android 12, please take a look at your AndroidManifest.xml and make sure to add this android:exported .
Read more >BM83SM1-00AB : fail to retrieve ble services on Android 12
Hello, From Android 12 phones, we can not retrieve the BLE services of the BLE device (which use BM83). We can scan and...
Read more >Use of All files access (MANAGE_EXTERNAL_STORAGE ...
This is only applicable to apps that target Android 11 (API level 30) and ... Without this core functionality, the app is "broken"...
Read more >Bug - Android 12 App crashes on startup due to error with ...
My unity project uses Google Ad Mob Unity Plugin v6.1.2 which is the latest version. Target api level is 31. The game runs...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@philips77 I’ve been testing the changes in #108 on our fork, and though it does prevent fatal crashes on Android 12+ caused by the mutability flag not being explicitly set, it now prevents scan results from being received in
PendingIntentReceiver(i.e. the intent received has no extras). This tells me that the correct flag there may beFLAG_MUTABLE, which can only be used if the project targets API 31 which it currently doesn’t.This issue may need to be reopened, and hopefully inspire a deeper look into how the project can safely target 31.
PR https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library/pull/108