Skip to content
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

Error Android 12: Non-fatal Exception: java.lang.IllegalArgumentException | requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent #746

Closed
2 of 5 tasks
ollm opened this issue Jul 15, 2022 · 1 comment

Comments

@ollm
Copy link

ollm commented Jul 15, 2022

Bug report

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

Currently no notifications are received on Android 12 and above if the Android SDK target is 31 and above

Error in Firebase Crashlytics:

Non-fatal Exception: java.lang.IllegalArgumentException: app.appname.app: 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:382)
       at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:673)
       at android.app.PendingIntent.getBroadcast(PendingIntent.java:660)
       at org.apache.cordova.firebase.FirebasePluginMessagingService.sendMessage(FirebasePluginMessagingService.java:242)
       at org.apache.cordova.firebase.FirebasePluginMessagingService.onMessageReceived(FirebasePluginMessagingService.java:205)
       at com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage(FirebaseMessagingService.java:235)
       at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(FirebaseMessagingService.java:185)
       at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(FirebaseMessagingService.java:172)
       at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(FirebaseMessagingService.java:161)
       at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService(EnhancedIntentService.java:78)
       at com.google.firebase.messaging.-$$Lambda$EnhancedIntentService$NSk2h75eWhBOI4TsAFgvvtv1g9o.run(:6)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@18.0.0:2)
       at java.lang.Thread.run(Thread.java:920)

Expected behavior:

Notifications should arrive without any problem in Android 12 and above

Steps to reproduce:

Build with Android SDK 31 and above and test sending notifications on a device running Android 12 and above.

Environment information

  • Cordova CLI version
    • cordova -v 11.0.0
@dpa99c
Copy link
Owner

dpa99c commented Jul 20, 2022

This above PR has been merged and released in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants