Search code examples
androidfluttercrashandroid-12

Flutter app crashes on startup on Android 12


I have published an app on Google Play and it is being used regularly. In the last update, I have released updated both, compileSdkVersion and targetSdkVersion to 31.

I have seen that users with an Android version less than 12 do not have any issues with the app, while those with an Android version 12 are facing an app crash whenever they try to open the app.

This is the message I get from Google Play Store:

enter image description here

Did anyone face a similar problem? Would appreciate any suggestion!


Solution

  • I have resolved the issue. Here is what I did:

    1. I have added android:exported="true" in my AndroidManifest.xml to all activities, services, or broadcast receivers that use intent filters
    2. I have added implementation 'androidx.work:work-runtime-ktx:2.7.0' in the dependencies section of my app level build.gradle (android/app/build.gradle)

    After that my app was working regularly on Android 12 and these changes did not affect the lower Android versions