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

Windows下调试Android App正常,构建时遇ninja及mergeDexRelease错误求助

解决Windows下Expo Android打包报错问题

报错详情

  • CMake构建失败:

    Task :expo-modules-core:buildCMakeRelWithDebInfo[armeabi-v7a] FAILED
    C/C++: ninja: error: manifest 'build.ninja' still dirty after 100 tries
    Task :expo-modules-core:buildCMakeRelWithDebInfo[arm64-v8a] FAILED
    C/C++: ninja: error: manifest 'build.ninja' still dirty after 100 tries

  • Dex合并失败:

    Task :app:mergeDexRelease FAILED

解决步骤

  • 清理CMake缓存:进入项目android/expo-modules-core/build目录,删除cmake文件夹后重试打包。
  • 关闭Gradle增量构建:在项目根目录的gradle.properties中添加org.gradle.caching=false,禁用缓存后重新打包。
  • 指定单一架构打包:在android/app/build.gradle的defaultConfig块中添加:
    ndk {
        abiFilters 'arm64-v8a'
    }
    
    仅构建arm64架构,规避多架构冲突。
  • 清理项目构建缓存:执行命令 gradlew clean,再运行 gradlew assembleRelease 重新打包。
  • 修复依赖版本:执行 npx expo install --fix,确保expo-modules-core与SDK版本匹配。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.09 22:03:14