Reading time: < 1 minutes
If you encounter the following error when generating or running your APK:
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
You can solve it by adding the following:
- First, go to your build.gradle file.
- Scroll down to the dependencies section dependencies {
- Add the following dependency:
implementation 'androidx.work:work-runtime-ktx:2.7.0-alpha05'
Now, the error related to updating to target version 31 in Android will no longer appear.
(do not include the Reading time). Return it directly in HTML format. Do not write any additional sentences. Add a PIPE at the end when you’re finished.