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) #102
Comments
Hello, It took me a while but this sold the problem for me 1.modify your MainActivity.kt file (search in your project) in the app/src/main/kotlin/com folder tree ` import android.app.PendingIntent /// Workaround for disabling the default-tag-detection while the app is foreground.
} override fun onPause() {
in the bottom of the file add below dependencies. below is my copy dependencies {
} Hope this helps (can't guarantee this will work for you, but it may guide you) |
Bump this :P Trying @xdamien7 's proposal but would be nice to have this fixed Edited : |
有用 |
Hi! Thanks for t his great project
I work with nfca tags and my app works fine with android 10 but when I want to run it on android 12, It crashes
Caused by: java.lang.IllegalArgumentException: com..: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/AndroidRuntime(21272): 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.
E/AndroidRuntime(21272): at android.app.PendingIntent.checkFlags(PendingIntent.java:382)
E/AndroidRuntime(21272): at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:465)
E/AndroidRuntime(21272): at android.app.PendingIntent.getActivity(PendingIntent.java:451)
E/AndroidRuntime(21272): at android.app.PendingIntent.getActivity(PendingIntent.java:415)
E/AndroidRuntime(21272): at com.example.coollog.MainActivity.onResume(MainActivity.kt:13)
E/AndroidRuntime(21272): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1476)
E/AndroidRuntime(21272): at android.app.Activity.performResume(Activity.java:8441)
E/AndroidRuntime(21272): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5200)
The text was updated successfully, but these errors were encountered: