React Native cli 集成Op-Sqlite编译超时问题解决

问题

./gradlew clean 卡在 CONFIGURING 20 分钟以上:

复制代码
<=------------> 10% CONFIGURING [20m 57s]
> :op-engineering_op-sqlite

根因

op-sqlite 硬编码 NDK 27.0.12077973,本地只有 27.1.12297006,Gradle 尝试自动下载 NDK 被网络阻塞。

日志关键行:

复制代码
C/C++: No NDK was found. Trying to download it now.
Warning: Still waiting for package manifests to be fetched remotely.

解决

修改 node_modules/@op-engineering/op-sqlite/android/build.gradle:

gradle 复制代码
android {
    ndkVersion = "27.1.12297006"  // 加这行
    namespace "com.op.sqlite"
    ...
}

删除 android/local.properties 中的 ndk.dir(避免 deprecated 警告),只保留 sdk.dir。

重新构建:

bash 复制代码
./gradlew clean --no-daemon

避坑

  • 统一项目内所有原生模块的 ndkVersion
  • ndk.dir 已废弃,用 ndkVersion 指定
  • CONFIGURING 超 5 分钟大概率在后台下载,加 --info 定位
相关推荐
Flynt6 天前
Shopify 弃 React Native 上了 HN 1272 分,我复现了它给 Agent 用的那套无头架构
react native·前端框架·agent
嵩风抚11 天前
一款HK银行APP的业务+技术
android·flutter·react native·html5
杉氧12 天前
RN 性能调优指南:重渲染(Re-renders)控制与长列表(FlatList)优化
android·前端·react native
光影少年12 天前
react navite process.nextTick 和 Promise.then 的执行顺序
前端·react native·react.js
光影少年13 天前
react navite浏览器 Event Loop 和 Node Event Loop 的区别
前端·javascript·react native·react.js·前端框架
做前端的娜娜子14 天前
施工蓝图:vite.config.js —— 项目的指挥中心
前端·react native·vite
光影少年14 天前
RN首屏加载速度优化全方案
react native·react.js·掘金·金石计划
光影少年15 天前
如何实现RN 多环境、多渠道打包
前端·react native·react.js