Quang Anh
Quang Anh

Reputation: 101

Flutter: Issue when migrate from Android 11 (API level 30) to Android 12

i'm facing with problem when migrate from Android 11 to Android 12

i have change my targetSdkVersion to 31 and add android:exported="true" to AndroidManifest but i'm still get error when build appbundle

/Users/anhdinhhoangquang/mobicloud/android/app/src/main/AndroidManifest.xml:15:9-22:20 Error:
        android:exported needs to be explicitly specified for element <receiver#com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
         *********************************************************
         *********************************************************

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseMainManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

BUILD FAILED in 6s
Running Gradle task 'bundleRelease'...                              6.9s
Gradle task bundleRelease failed with exit code 1

i've solve problem by the way

<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"
            android:exported="true">
</receiver>

my build.grade file

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.mobifone.mobicloud"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

Upvotes: 1

Views: 314

Answers (1)

Umut Kaya
Umut Kaya

Reputation: 1

AndroidManifest.xml edited like this for exported="true";

https://paste2.org/xt7K99ZK

And check build gradle files.

Upvotes: 0

Related Questions