得到警告"NDK缺少“平台"".目录.'没有NDK [英] Getting warning "NDK is missing a 'platforms" directory.' with no NDK

查看:3461
本文介绍了得到警告"NDK缺少“平台"".目录.'没有NDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个仅使用Android SDK而不使用NDK的项目,但是每当使用gradle构建NDK时,我都会收到警告:

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:

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.

似乎是一个非常明确的警告.我没有使用ndk,所以我的android-sdk中没有任何ndk-bundle.问题是我没有设置ANDROID_NDK_HOME,并且我的local.properties文件(似乎由Android Studio生成)没有设置NDK:

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:

sdk.dir=/usr/local/opt/android-sdk

我确实有一个ANDROID_HOME环境变量:

I do have an ANDROID_HOME environment variable:

ANDROID_HOME=/usr/local/opt/android-sdk

系统是一台Mac,但是我们似乎在Docker中遇到了同样的问题.有人知道如何消除此警告吗?

System is a mac, but we seem to get the same issue in Docker. Anyone know how to get rid of this warning?

推荐答案

请参考以下两个链接:

https://github.com/requery/requery/issues/467

这是由于升级到Android gradle插件2.3引起的 (com.android.tools.build:gradle:2.3.0).

This is caused by upgrading to Android gradle plugin 2.3 (com.android.tools.build:gradle:2.3.0).

在先前版本的插件中,数据绑定包名称(其中 (产生BR档案)在产生的注解中提供 文件.在新版本中,它作为注释处理器选项传递 现在可以处理了.

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.

更新版本即将推出,临时解决方法是 只需使用以前的android gradle插件2.2.2

An updated version will be available soon, a temporary workaround is to simply use the previous android gradle plugin 2.2.2

这篇关于得到警告"NDK缺少“平台"".目录.'没有NDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆