Java 收到警告“NDK 缺少‘平台’目录。” 没有 NDK
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44730178/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting warning "NDK is missing a 'platforms" directory.' with no NDK
提问by CorayThan
I've got a project that only uses the Android SDK, not the NDK, but I'm getting warnings whenever I build with gradle about the NDK:
我有一个只使用 Android SDK 而不是 NDK 的项目,但是每当我使用关于 NDK 的 gradle 构建时,我都会收到警告:
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/opt/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.
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/opt/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.
Seems like a pretty clear warning. I'm not using the ndk, so there is no ndk-bundle
in my android-sdk
. The issue is that I don't have an ANDROID_NDK_HOME
set, and my local.properties
file (which appears to be generated by Android Studio) doesn't set the NDK:
似乎是一个非常明确的警告。我没有使用 ndk,所以ndk-bundle
我的android-sdk
. 问题是我没有ANDROID_NDK_HOME
设置,而且我的local.properties
文件(似乎是由 Android Studio 生成的)没有设置 NDK:
sdk.dir=/usr/local/opt/android-sdk
sdk.dir=/usr/local/opt/android-sdk
I do have an ANDROID_HOME environment variable:
我确实有一个 ANDROID_HOME 环境变量:
ANDROID_HOME=/usr/local/opt/android-sdk
ANDROID_HOME=/usr/local/opt/android-sdk
System is a mac, but we seem to get the same issue in Docker. Anyone know how to get rid of this warning?
系统是 mac,但我们似乎在 Docker 中遇到了同样的问题。有谁知道如何摆脱这个警告?
采纳答案by paulsm4
Please refer to these two links:
请参考这两个链接:
This is caused by upgrading to Android gradle plugin 2.3 (com.android.tools.build:gradle:2.3.0).
In previous versions of the plugin the databinding package name (where the BR file is generated) was provided on an annotation in a generate file. In the new version it's passed as a annotation processor option which is now handled.
An updated version will be available soon, a temporary workaround is to simply use the previous android gradle plugin 2.2.2
这是由于升级到 Android gradle 插件 2.3 (com.android.tools.build:gradle:2.3.0) 引起的。
在以前版本的插件中,数据绑定包名称(生成 BR 文件的位置)在生成文件的注释中提供。在新版本中,它作为注释处理器选项传递,现在已处理。
更新版本即将推出,临时解决方法是简单地使用以前的 android gradle 插件 2.2.2