首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Android: Gradle build一直在使用最新的NDK版本,而不是使用已经安装的版本。

Android: Gradle build一直在使用最新的NDK版本,而不是使用已经安装的版本。
EN

Stack Overflow用户
提问于 2020-12-17 01:36:47
回答 1查看 796关注 0票数 0

我在Linux服务器上使用./gradlew build运行一个gradle构建,gradle一直试图安装最新版本的NDK (22)。

代码语言:javascript
运行
复制
Welcome to Gradle 5.1.1!

Here are the highlights of this release:
 - Control which dependencies can be retrieved from which repositories
 - Production-ready configuration avoidance APIs

For more details see https://docs.gradle.org/5.1.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :ui_manager_library
Checking the license for package NDK in /usr/local/android-sdk/licenses
License for package NDK accepted.
Preparing "Install NDK (revision: 22.0.7026061)".
"Install NDK (revision: 22.0.7026061)" ready.
Installing NDK in /usr/local/android-sdk/ndk-bundle
"Install NDK (revision: 22.0.7026061)" complete.
"Install NDK (revision: 22.0.7026061)" finished.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /usr/local/android-sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.


FAILURE: Build failed with an exception.

服务器已经安装了NDK并设置了路径。我们需要使用20.0.5594570*

代码语言:javascript
运行
复制
ANDROID_NDK_HOME='/usr/local/android-sdk/ndk/20.0.5594570'

我怎么能让Gradle看到这个?我的应用程序/build.gradle也有版本集

代码语言:javascript
运行
复制
android {
    ndkVersion '20.0.5594570'
}
EN

回答 1

Stack Overflow用户

发布于 2020-12-17 22:18:28

正如WS Ayan所指出的,将Android插件更新到适当的版本使我们能够执行NDK版本。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65333518

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档