-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent #52
Comments
The cause of this error can be found in the RNSerialPortModule.java file.method : requestUserPermission()
Android API 31 onwards you need to set explicit FLAG while creating a PendingIntent https://developer.android.com/reference/android/app/PendingIntent#FLAG_MUTABLE
Till the time this fix is available you can patch it using patch-package :
Hopefully, this works for you as well if someone is facing the same error. |
Fix for melihyarikkaya#52- melihyarikkaya#52 setting of required flag FLAG_MUTABLE for sdk-31
I've fixed that problem on my branch: |
After updating android target Sdk to 31. Before that it was working fine.
build.gradle
As soon as a USB device is connected following error gets thrown :
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.
The text was updated successfully, but these errors were encountered: