问题
./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定位