안드로이드
[안드로이드] Manifest merger failed : android:exported needs to be explicitly specified for <activity> 에러 핸들링
개굴이모자
2023. 5. 14. 00:02
반응형
실로 오랜만에 타겟 버전을 올렸더니 아래와 같은 에러가 발생하였다.
![](https://t1.daumcdn.net/keditor/emoticon/friends1/large/034.gif)
Manifest merger failed : android:exported needs to be explicitly specified for . 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.
자세히보면, Android 12 를 타겟팅하는 경우 Manifest 파일에서 android:exported 를 설정 해주어야한다는 내용이다.
기존에는 기본으로 적용되었으나, 이제는 필수로 지정되어야하게 변경되었다고 한다.
추가로, MainActivity 의 경우는 exported = “true” 가 되어야한다. (경고가 발생할 수 있음)
<activity android:name=".presentation.MainActivity"
android:screenOrientation="portrait" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
참고 링크
반응형