You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助解决安卓应用安装错误INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

解决INSTALL_PARSE_FAILED_MANIFEST_MALFORMED安装错误

你的AndroidManifest.xml里有两处关键问题导致解析失败:

  1. pathPattern的XML转义错误
    XML中反斜杠\是转义字符,要匹配.app后缀,需要用双反斜杠\\来表示实际的点号转义。你当前的android:pathPattern=".*\.app"写法会被XML解析器错误处理,直接引发manifest格式畸形。

  2. intent-filter无需重复设置android:exported
    <intent-filter>的android:exported属性会继承所属Activity的配置,不需要在每个intent-filter上重复声明,冗余配置可能触发解析异常。

修改后的Manifest相关代码:

<application xmlns:tools="http://schemas.android.com/tools"
    android:name=".MyApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:usesCleartextTraffic="true"
    tools:overrideLibrary="androidx.multidex.instrumentation">

    <activity
        android:name=".activity.MainActivity"
        android:exported="true"
        android:label="@string/app_name"
        android:noHistory="true"
        android:theme="@style/AppTheme.NoActionBar.Splash">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <intent-filter
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />

            <data android:scheme="file" />
            <data android:host="*" />
            <data android:mimeType="*/*" />
            <data android:pathPattern=".*\\.app" />
        </intent-filter>

    </activity>

</application>

额外排查点:

  • 检查整个Manifest文件是否存在未闭合的标签、拼写错误的属性名
  • 确认所有四大组件(Activity、Service、BroadcastReceiver、ContentProvider)的android:exported属性都已正确设置(针对Android 12+)
  • 验证包名确实为全小写,无特殊字符

内容的提问来源于stack exchange,提问作者Harshali

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 13:00:24