2022.01.18 TIL

김민수·2022년 1월 19일
0

Android

target Sdk를 31로 설정하면 생기는 문제

Intent-filter를 사용하는 컴포넌트에는 android:exported 속성을 지정해야한다.

App에 기본 Manifest.xml에는 exported 속성이 지정되어 있는데도 불구하고 아래와 같은 에러가 발생한다.

Merging Errors: Error: 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 for details. main manifest (this file)

원인

안드로이드 빌드할 때, 라이브러리에서 사용하는 Manifest 파일을 모두 병합한다.

이때 일부 라이브러리의 Manifest 파일에서 intent-filter를 사용하는 컴포넌트에 android:exported 속성이 지정되어 있지 않다.

해결방법

Merged Manifest 탭 클릭

Manifest file을 하나씩 확인하며 android:exported 속성이 필요한 부분에 설정

이번 에러의 원인은 test:core:1.2.0에 속성이 빠져있어서 추가함

profile
도전을 즐기는

0개의 댓글