본문 바로가기
프로그래밍/Flutter

Flutter tip : android:exported error when targetSdkVersion is 31 or higher

by drogrammer 2023. 4. 24.
반응형

1. Problem

* What went wrong:
Execution failed for task ':app:processReleaseMainManifest'.
> Manifest merger failed : android:exported needs to be explicitly specified for element <activity#com.example.agauction.MainActivity>. 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.

 

2. Solution

Add android:exported="true" in your ".MainActivity" settings in android/app/src/main/AndroidManifest.xml

example.

        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:exported="true"
            android:windowSoftInputMode="adjustResize">

 

 

반응형

댓글