2

I am currently working on building a music app Wavelet. Here's my dependencies: package.json

I usually debug on an Android 11 emulator, but when using an Android 12 emulator and my physical device on Android 12L it crashes.

I was able to pick this log from my physical device.

2
  • Well, the error log is pretty clear: "Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent." Android 12 is API 31, did you try setting FLAG_IMMUTABLE or FLAG_MUTABLE ? Commented Apr 17, 2022 at 16:13
  • I have no idea where to set it, I read this but couldn't understand where to add. Commented Apr 18, 2022 at 11:38

1 Answer 1

6

Go into build.gradle and find dependencies

Look for androidx.work:work-runtime-ktx...

Add or update it to:

// fix for crash API 31
implementation "androidx.work:work-runtime-ktx:2.7.0"
Sign up to request clarification or add additional context in comments.

1 Comment

I can't believe it! That that one line is all it took (I think) to get a react native app to stop crashing and be able to submit to play store. Thank you so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.