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

change PendingIntent to FLAG_IMMUTABLE #887

Closed
wants to merge 1 commit into from

Conversation

dagovalsusa
Copy link

change the pending intent from FLAG_UPDATE_CURRENT to FLAG_IMMUTABLE.
FLAG_UPDATE_CURRENT cause a crash/error on Android 12

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., null, java.lang.IllegalArgumentException: app.aworld: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.

I've tested on simulator with Android 12

Replace this paragraph with a description of what this PR is changing or adding, and why.

If there's an open issue your PR is fixing, please list it here.

Pre-launch Checklist

  • I read the CONTRIBUTING.md and followed the process outlined there for submitting PRs.
  • My change is not breaking and lands in minor branch OR my change is breaking and lands in major branch.
  • If I'm the first to contribute to the next version, I incremented the version number in pubspec.yaml according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change (format: * DESCRIPTION OF YOUR CHANGE (@your-git-username)).
  • I updated/added relevant documentation (doc comments with ///).
  • I ran dart analyze.
  • I ran dart format.
  • I ran flutter test and all tests are passing.

change the pending intent from FLAG_UPDATE_CURRENT to FLAG_IMMUTABLE.
FLAG_UPDATE_CURRENT cause a crash/error on Android 12

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., null, java.lang.IllegalArgumentException: app.aworld: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.

I've tested on simulator with Android 12
@samry
Copy link

samry commented Dec 16, 2021

FWIW: I was running into the same issues/errors as described in the PR when targeting SDK version 31, and this commit fixes it.

@ryanheise
Copy link
Owner

@samry can you take a look at #836 where this issue is discussed? I would like to get a fix for this released, but #836 is where the important discussions have taken place, and I can't merge it until people can test the work being done there.

@ryanheise ryanheise closed this Dec 19, 2021
@ryanheise
Copy link
Owner

I am closing this since the fix/android_intent_flags branch already exists and would suggest people continue the discussion at #836 .

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants