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

Unity上传Play Console报错:需配置AndroidManifest的android:exported属性

解决Unity项目上传Google Play Console的Android 12+ android:exported 配置问题

核心排查点

Android 12及以上版本强制要求:所有带有<intent-filter>的组件(Activity、Activity Alias、Service、Broadcast Receiver)必须显式声明android:exported属性——这包括Unity自动引入的第三方插件内的组件,绝非只需要修改你自己添加的主Activity。

具体修复步骤

  1. 定位未配置的组件

    • 找到Build后生成的合并清单文件,路径为你的项目目录/Temp/StagingArea/AndroidManifest.xml
    • 搜索所有包含<intent-filter>的标签,逐一检查每个标签是否存在android:exported属性,标记缺失的组件。
    • 重点排查第三方插件(如广告、统计类SDK)自带的Manifest,这类插件的配置往往未适配Android 12+,会被合并到最终清单中引发报错。
  2. 在自定义Manifest中补全配置

    • 打开Plugins/Android下的自定义AndroidManifest.xml,针对每个缺失exported的组件添加对应配置:
      • 主启动Activity(通常是UnityPlayerActivity)示例:
        <activity
            android:name="com.unity3d.player.UnityPlayerActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        
      • 第三方插件的Service/Broadcast Receiver示例(根据组件用途设置true或false:需要被外部调用则设为true,仅内部使用设为false):
        <service
            android:name="com.example.thirdparty.SomeService"
            android:exported="false">
            <intent-filter>
                <!-- 保留插件原有的intent-filter内容 -->
            </intent-filter>
        </service>
        
  3. 验证最终合并清单

    • 重新Build项目,再次打开Temp/StagingArea/AndroidManifest.xml,确认所有带<intent-filter>的组件都已配置android:exported属性,无遗漏。
  4. 处理Unity自动生成的组件

    • 对于Unity自身生成的组件(如UnityPlayerProxyActivity),直接在自定义Manifest中添加android:exported属性即可,Unity的清单合并机制会优先使用你的自定义配置。

常见避坑提示

  • 不要只修改主Activity,第三方插件的组件是报错高发区,必须逐个排查。
  • 最终生效的是合并后的清单文件,务必以此为准,不要仅依赖自己编写的自定义Manifest。
  • 若出现exported属性冲突,自定义Manifest中的配置会覆盖插件原有配置,确保你的设置符合Android 12+规范。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.25 09:32:52