오랜만에 앱 업데이트..

또 강제 업그레이드?!

build.grale 수정하고 나니

compileSdkVersion, targetSdkVersion -> 31
역시나..

> 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 값을 지정하면 앱이 실행 안됨

 

 

+ Recent posts