[android] The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

깨미·2022년 6월 14일
0

📱 Android 📱

목록 보기
15/16
post-thumbnail
post-custom-banner

Android 12 이상으로 Run 'app'을 진행할 시 발생하는 에러.

Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
List of apks:
[0] 'D:\AppDetect\app\build\outputs\apk\debug\app-debug.apk'
Installation failed due to: 'null'

내 폰이 갤럭시s22인데 이 폰으로 run 시키니 해당 에러가 뜬다.

해결 방법
1. build.gradle (Module) 에서 compileSdkVersion 31, targetSdkVersion 31로 변경
2. manifests 에서 activity 안에 android:exported="true" 로 설정하기 (이 방법으로 해결)

문제 코드

//AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.kkaemi.appdetect">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppDetect">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

수정 코드

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.kkaemi.appdetect">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppDetect">
        <activity android:name=".MainActivity"
            android:exported="true"> <!-- 추가 -->
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
profile
vis ta vie
post-custom-banner

0개의 댓글