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

Ionic应用发布Google Play遇android:exported配置异常求助

Ionic应用上传Google Play遇Android 12+导出属性问题的解决办法
  • 直接修改项目主AndroidManifest模板
    找到项目根目录下的android/app/src/main/AndroidManifest.xml,定位所有带<intent-filter>的activity、service或broadcast receiver标签,手动添加android:exported="true"(主Activity必须设为true,其他组件根据是否需要对外暴露设置true/false,但只要有intent filter就必须明确声明该属性)。

  • 排查插件Manifest覆盖问题
    有些插件自带的Manifest片段会覆盖你的配置,构建后打开platforms/android/app/build/intermediates/manifests/full/release/AndroidManifest.xml,找出哪些组件的android:exported被改成了false。找到对应插件后,要么修改插件内部的Manifest文件,要么在项目主Manifest的对应组件标签里加上tools:replace="android:exported"强制覆盖:

    <!-- 示例:强制覆盖插件service的exported属性 -->
    <service
        android:name="com.example.PluginService"
        android:exported="true"
        tools:replace="android:exported" />
    

    注意要在Manifest根标签manifest里添加tools命名空间:xmlns:tools="http://schemas.android.com/tools"

  • 调整Gradle配置
    打开android/app/build.gradle,确保compileSdkVersion和targetSdkVersion都设置为31及以上(对应Android 12+),避免因版本过低导致的Manifest合并异常。

  • 重新构建验证
    执行命令ionic cordova build android --release --prod重新构建,之后再次检查构建后的Manifest文件,确认android:exported属性保持正确设置。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.05 02:50:35