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

React Native 0.69.1安卓新架构configureBuildForHermes构建失败

故障说明

执行Android端Debug版本打包时,构建流程推进到Android构建配置环节失败,核心失败任务为:ReactAndroid:hermes-engine:configureBuildForHermes,完整报错日志如下:

> Task :ReactAndroid:hermes-engine:configureBuildForHermes FAILED
CMake Deprecation Warning at CMakeLists.txt:42 (cmake_policy):
  The OLD behavior for policy CMP0026 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- The following ICU libraries were not found:
--   uc (required)
--   i18n (required)
--   data (required)
--   uc (required)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY _ICU_REQUIRED_LIBS_FOUND) (Required is at least version "52")
CMake Error at CMakeLists.txt:520 (message):
  Unable to find ICU.


-- Configuring incomplete, errors occurred!
See also "/home/shikari/App Development/WhatScan/node_modules/react-native/ReactAndroid/hermes-engine/build/hermes/CMakeFiles/CMakeOutput.log".
See also "/home/shikari/App Development/WhatScan/node_modules/react-native/ReactAndroid/hermes-engine/build/hermes/CMakeFiles/CMakeError.log".
故障原因

日志开头的CMake CMP0026策略弃用警告为非阻断提示,不会导致构建失败。真正卡住构建流程的原因是:本地编译环境缺少版本≥52的ICU(International Components for Unicode,Unicode国际组件)库,CMake配置Hermes编译参数时无法定位到对应依赖,直接抛出错误终止流程。

修复步骤
  • 对照当前使用的编译操作系统,安装对应ICU开发依赖:
    • Debian/Ubuntu系Linux:执行命令sudo apt update && sudo apt install libicu-dev
    • Fedora/CentOS/RHEL系Linux:执行命令sudo dnf install libicu-devel
    • Arch系Linux:执行命令sudo pacman -S icu
    • macOS(Homebrew环境):先执行brew install icu4c完成安装,再执行以下命令配置环境变量,保证CMake能识别到ICU路径:
      export ICU_ROOT=$(brew --prefix icu4c)
      export PATH="$ICU_ROOT/bin:$PATH"
      
  • 依赖安装完成后清理旧构建缓存,避免残留的错误缓存导致依赖识别失败,依次执行以下命令:
    cd android
    ./gradlew clean
    cd ..
    
  • 重新执行Debug打包命令,即可正常通过该构建环节。

内容的提问来源于stack exchange,提问作者Muhammad Rafeh Atique

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.27 04:45:37