Flutter App targeting Android 12 CRASHES => FLAG_IMMUTABLE or FLAG_MUTABLE to be specified when creating a PendingIntent

Viewed 2591

I develop App in Flutter. Would anyone suggest me where exactly I should change PendingIntent to use FLAG_IMMUTABLE? App installs on simulator but crashes at launching. Would anyone give a short example where to change it?

I read that workmanager 2.7.1 can help to solve the problem. Where exactly should it be added?

2 Answers

It worked for me simply by adding implementation 'androidx.work:work-runtime-ktx:2.7.0' in the dependencies section of your android/app/build.gradle

It's the proposed solution of this issue: https://github.com/flutter/flutter/issues/93609

I have faced same issue that my flutter app stop running into Android 12 devices and i m able to fix using below two changes:

  1. I have added implementation 'androidx.work:work-runtime-ktx:2.7.0' into android/app/build.gradle dependencies section.

  2. I have added android:exported="true" into AndroidManifest.xml for all activity tag.

Related