오랜만에 앱 업데이트..
build.grale 수정하고 나니
> Task :app:processDebugMainManifest FAILED [androidx.vectordrawable:vectordrawable-animated:1.0.0] /Users/wonhochoe/Downloads/gradle-4.8.1/caches/transforms-2/files-2.1/17c854dfb65cc4cb6b6a29797e63f450/vectordrawable-animated-1.0.0/AndroidManifest.xml Warning: Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.0. /Users/wonhochoe/AndroidStudioProjects/android-220803/app/src/main/AndroidManifest.xml Error: 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. /Users/wonhochoe/AndroidStudioProjects/android-220803/app/src/main/AndroidManifest.xml Error: 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. See http://g.co/androidstudio/manifest-merger for more information about the manifest merger. |
그대로 해석하면, Android 12 이상 타겟팅하고 있는 컴포넌트(Activity, service 등등) 중 인텐트 필터 포함하고 있는 애들은
명시적으로 android:exported 값을 넣어줘야함.
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/AppTheme"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
android:exported
이 요소는 다른 애플리케이션의 구성요소에서 활동을 시작할 수 있는지를 설정합니다.
"true"인 경우 모든 앱에서 활동에 액세스할 수 있으며 정확한 클래스 이름으로 활동을 시작할 수 있습니다.
'false'인 경우 활동은 같은 애플리케이션의 구성요소나 사용자 ID가 같은 애플리케이션, 권한이 있는 시스템 구성요소에서만 시작될 수 있습니다. 이는 인텐트 필터가 없는 경우의 기본값입니다.
앱의 활동에 인텐트 필터가 포함되면 다른 앱에서 활동을 시작할 수 있도록 이 요소를 "true"로 설정합니다. 예를 들어 활동이 앱의 기본 활동이고 category 'android.intent.category.LAUNCHER'를 포함한 경우입니다.
이 요소가 'false'로 설정되어 있고 앱에서 활동을 시작하려고 하면 시스템에서 ActivityNotFoundException이 발생합니다.
'android.intent.category.LAUNCHER' 인텐트 필터 갖고 있는 Activity에 android: exported = false 값을 지정하면 앱이 실행 안됨
'android' 카테고리의 다른 글
Android Target API Level 34로 변경 후 빌드 안됨. (3) | 2024.10.31 |
---|---|
[FCM] OAuth 2.0 Playground로 message 보내기 (1) | 2024.10.18 |
[cordova] exitApp 플러그인 추가 안됨 (0) | 2024.07.22 |
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. (0) | 2023.01.09 |
android HTTPS, SSL 인증서 적용하기 (0) | 2022.02.18 |