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.

  • 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 ? – RamaProg Apr 17 '22 at 16:13
  • I have no idea where to set it, I read [this](https://stackoverflow.com/questions/67045607/how-to-resolve-missing-pendingintent-mutability-flag-lint-warning-in-android-a) but couldn't understand where to add. – quixotic_welkin Apr 18 '22 at 11:38

1 Answers1

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"
RamaProg
  • 1,106
  • 7
  • 15
  • 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! – Trozdol Jan 08 '23 at 05:48