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 定位
相关推荐
前端小D1 天前
React Native项目开发(iOS侧为例)
javascript·react native·react.js
大龄秃头程序员2 天前
从源码里看懂 React Native 新架构:TurboModule 与 Fabric 到底是怎么跑起来的?
react native
前端小D3 天前
React Native Android 项目搭建
android·react native·react.js
hhhjhl5 天前
React Native 三方库「react-native-sha256」的鸿蒙化适配指南
react native·华为·harmonyos
2601_949970695 天前
React Native 三方库「react-native-version-check」的鸿蒙化适配指南
react native·华为·harmonyos
hhhjhl5 天前
React Native 三方库「react-native-proximity」的鸿蒙化适配指南
react native·华为·harmonyos
2601_949970695 天前
React Native 三方库「react-native-media-notification」的鸿蒙化适配指南
react native·华为·harmonyos
GitCode官方6 天前
从大语言模型到具身智能:百度百舸 LoongForge 入驻 AtomGit
人工智能·react native·百度·harmonyos·atomgit
2501_915918418 天前
Windows 上开发 React Native iOS,真机调试、Fast Refresh 与打包 ipa
windows·vscode·react native·ios·个人开发·swift·敏捷流程
2501_948122639 天前
Qs 跨端三方库仓颉适配全流程
python·react native·django·tornado