文章目录
Android12 install报错 The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
解决办法
以Android12为适配平台的app,其中凡是四大组件中包含 intent-filter 的,都需要声明 android:exported 属性,若 intent-filter 中包含LAUNCHER,则最好声明为 android:exported=“true”
例如:
<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>
可通过清单文件的Merged Manifest 查看使用 intent-filter 的四大组件
若依旧报错 Installation failed due to: ‘-127’ ,则可尝试在清单文件中添加以下参数
<permission-group android:name="${applicationId}.andpermission" />