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

Flutter项目安卓构建报错:app:processDebugResources 解决方案求助

Flutter安卓构建报错:资源找不到(mipmap/ic_launcher、LaunchTheme、NormalTheme)

解决步骤:

  • 检查启动图标资源
    确认android/app/src/main/res/mipmap-*系列文件夹下都有ic_launcher.png(对应不同分辨率的图标文件)。如果缺失:

    • 若已配置flutter_launcher_icons插件,执行flutter pub run flutter_launcher_icons:main自动生成图标;
    • 手动准备符合安卓尺寸规范的图标,放到对应mipmap文件夹,确保文件名完全匹配。
  • 验证主题样式定义
    打开android/app/src/main/res/values/styles.xml,确认存在LaunchTheme和NormalTheme的定义,标准示例如下:

    <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:windowBackground">@drawable/launch_background</item>
    </style>
    <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:windowBackground">@drawable/launch_background</item>
    </style>
    

    若文件不存在或样式缺失,直接创建文件并补充上述代码。

  • 清理构建缓存重试
    依次执行以下命令清理缓存后重新构建:

    flutter clean
    cd android && ./gradlew clean
    cd .. && flutter pub get
    
  • 确认AndroidManifest.xml引用正确性
    打开android/app/src/main/AndroidManifest.xml,检查以下引用无拼写错误:

    • 图标:android:icon="@mipmap/ic_launcher"
    • 启动主题:android:theme="@style/LaunchTheme"
    • 正常主题:android:theme="@style/NormalTheme"
      同时确保包名com.example.c3mobiredo与项目配置一致,避免资源引用的包名不匹配。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.13 17:50:24