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

Flutter应用INSTALL_PARSE_FAILED_MANIFEST_MALFORMED报错求助

问题分析与解决方案

错误提示明确指向com.microsoft.appcenter.distribute.DeepLinkActivity,而非你配置的MainActivity。当应用目标SDK版本为31(Android 12)及以上时,所有包含intent filter的Activity必须显式声明android:exported属性,你目前只给自己的MainActivity加了该属性,没处理AppCenter的这个Activity,所以错误依然存在。

解决步骤

1. 显式声明DeepLinkActivity并设置exported

在你的AndroidManifest.xml的<application>标签内,添加以下代码:

<activity
    android:name="com.microsoft.appcenter.distribute.DeepLinkActivity"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- 替换成你AppCenter分发配置的专属scheme -->
        <data android:scheme="appcenter-your-app-scheme" />
    </intent-filter>
</activity>

如果该Activity已经被AppCenter依赖库自动合并到Manifest中(你自己的代码里没写但编译后存在),也可以用tools:replace强制覆盖属性:

<activity
    android:name="com.microsoft.appcenter.distribute.DeepLinkActivity"
    android:exported="true"
    tools:replace="android:exported" />

2. 验证SDK版本配置

检查android/app/build.gradle中的配置,确保目标SDK版本符合要求:

android {
    compileSdkVersion 31 // 或更高版本
    defaultConfig {
        targetSdkVersion 31 // 或更高版本
    }
}

3. 清理重建项目

执行以下命令清理缓存并重新构建:

flutter clean
flutter pub get
flutter run

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.27 07:25:36