본문 바로가기

android

안드로이드 Android 12 API 수준 31 이상 타게팅 INSTALL_PARSE_FAILED_MANIFEST_MALFORMED 에러

반응형

문제 발생

 

앱 업로드를 진행하려고 하는데 아래와 같은 에러 발생

현재 앱이 30의 API 수준을 타겟팅하고 있지만, 보안 및 성능에 최적화된 최신 API를 기반으로 앱을 빌드하려면 API 수준 31 이상을 타겟팅해야 합니다. 앱의 타겟팅 API 수준을 31 이상으로 변경하세요. 

 

https://developer.android.com/google/play/requirements/target-sdk

 

Google Play의 대상 API 수준 요구사항 충족하기  |  Android Developers

Google Play의 대상 API 수준 요구사항 충족하기 APK를 업로드하는 경우 Google Play의 대상 API 수준 요구사항을 충족해야 합니다. 새 앱과 앱 업데이트는 Android 11(API 수준 30) 이상을 타겟팅해야 합니다.

developer.android.com

관련 페이지를 보니

 

2022년 8월부터 신규 앱은 API 수준 31(Android 12) 이상을 타겟팅하고 동작 변경사항에 맞게 조정해야 합니다.

Wear OS 앱은 API 수준 28 이상을 타겟팅해야 합니다.

 

8월부터 신규 앱은 31 이상을 타겟팅 해야하는군요!

 

Target SDK 버전을 31 (Android 12)로 올려서 빌드하고

테스트를 위해 apk를 설치하려고 하니 아래와 같은 에러가 발생 (그냥 될 리가 없지 ... ) 하면서 설치가 안됨. 

 

adb: failed to install halloweenwallpaper-release.apk: 

Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI:  /data/app/vmdl274827136.tmp/base.apk (at Binary XML file line #62): 

org.cocos2dx.cpp.AppActivity: Targeting S+ (version 31 and above) requires that an explicit value for 

android:exported be defined when intent filters are present]

 

반응형

문제 해결

AndroidManifest.xml 파일에 android:exported 를 true 나 false 로 명시적으로 선언해주면 됩니다.

intent-filter 태그를 포함하고 있어서 android:exported 옵션을 true로 설정.

 

<activity
    android:name="org.cocos2dx.cpp.AppActivity"
    android:screenOrientation="portrait"
    android:configChanges="orientation|keyboardHidden|screenSize"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
    android:launchMode="singleTask"
    android:taskAffinity=""
    android:exported="true" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

 

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

 

Android 개발자  |  Android Developers

애플리케이션의 시각적 사용자 인터페이스 일부를 구현하는 활동(Activity 서브클래스)을 선언합니다. 모든 활동은 매니페스트 파일의 {@code} 요소로 나타내야 합니다. 여기에 선언되지 않은 활동

developer.android.com

 

반응형