我有一个仅使用 Android SDK 而不是 NDK 的项目,但每当我使用 gradle 构建时都会收到有关 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,所以没有ndk-bundle
in my android-sdk
。问题是我没有ANDROID_NDK_HOME
设置,和我的local.properties
文件(似乎由 Android Studio 生成)未设置 NDK:
sdk.dir=/usr/local/opt/android-sdk
我确实有一个 ANDROID_HOME 环境变量:
ANDROID_HOME=/usr/local/opt/android-sdk
系统是Mac,但我们似乎在Docker中遇到了同样的问题。有人知道如何摆脱这个警告吗?
请参考这两个链接:
如何修复 android studio 2.3 NDK 错误? https://stackoverflow.com/questions/42682357/how-to-fix-android-studios-2-3-ndk-bug
https://github.com/requery/requery/issues/467 https://github.com/requery/requery/issues/467
这是由于升级到Android gradle插件2.3导致的
(com.android.tools.build:gradle:2.3.0)。
在插件的早期版本中,数据绑定包名称(其中
BR 文件已生成)在生成中的注释上提供
文件。在新版本中,它作为注释处理器选项传递
现在正在处理。
更新版本即将推出,临时解决方法是
简单地使用以前的android gradle插件2.2.2
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)