Lumpy Space Princess - Adventure Time
공부/Android

[Android] 오류 해결 - Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported`...

yaebb_82 2022. 5. 11.

 

1. 오류 발생

Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : 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.

 

build.gradle(app) - compileSdkVersion 모습

 

새로 프로젝트를 만들면서 빌드를 했는데, 위와 같은 오류가 발생하면서 빌드에 실패하게 되었다.

해당 오류는 Android 12(또는 12 이상)를 타켓팅 하는 경우, build.gradle(app) - compileSdkVersion이 31로 되어 있을 때 발생하는 오류이다.

 

 

 

2. 해결 방법

AndroidManifest 파일 - <application> - <activity> 내부에 android:exported="true"를 써주면 된다.

android:exported의 값은 true/false 로 줄 수 있는데, 애뮬레이터를 사용하려면 true로 값을 주면 된다.

Android 12 이전에는 기본값이 자동으로 들어갔었는데, Android 12부터는 이렇게 직접적으로 설정을 해주어야 한다고 한다.

 

 

 

해당 오류와 관련하여 자세한 내용은 아래의 문서를 통해 확인할 수 있다.

https://developer.android.com/guide/topics/manifest/activity-element#exported

 

 

 

반응형

댓글