问题描述
No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669
问题原因
20年2月-6月发行的Android Gradle plugin 3.6-4.1之间的版本,如果项目有依赖ndk,可能存在编译不通过问题。4.1.0-beta01已修复该bug。
解决方案
- 修改Gradle版本为3.6以下或4.1-beta01以上的版本
- Install the older NDK it is looking for (side-by-side): sdkmanager ‘ndk;20.0.5594570’
- Manually specify the newer version in :
android {
compileSdkVersion 29
ndkVersion “21.0.6113669”
//…
} - Uninstall the NDK (if you don’t need it for other projects): sdkmanager --uninstall ‘ndk-bundle’ This is essentially the same as deleting the NDK folder(s) as others have suggested in this thread.
参考资料
- /gradle/gradle/issues/12440
- /issues/144111441
- /issues/152075797
- /actions/virtual-environments/issues/643