魅力程序猿

  • 首页
  • Java
  • Android
  • APP
    • 扑克计分器
    • Video Wallpaper
  • 联系我
  • 关于我
  • 资助
道子
向阳而生
  1. 首页
  2. Android
  3. 正文

解决Android编译NDK is missing a "platforms" directory.

2018年12月12日 19731点热度 0人点赞 0条评论
在采用Gradle构建Android项目时候出现如下错误信息:
Executing tasks: [:app:assembleRelease]
Configuration on demand is an incubating feature.
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 /home/android-linux-sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

Incremental java compilation is an incubating feature.
:app:buildInfoDebugLoader
:app:buildNative FAILED
:app:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:buildNative'.
> A problem occurred starting process 'command '/home/android-linux-sdk/ndk-bundle/ndk-build''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 6.369 secs
解决方法:
该错误信息说明在“/home/android-linux-sdk/ndk-bundle/”文件夹下找不到“ndk-build”文件,因为Android Studio未自带NDK开发工具,因此会出现此错误。
到“https://developer.android.google.cn/ndk/downloads/index.html”下载Linux 64 位 (x86)版本,我下载的时候,版本号为:android-ndk-r16b-linux-x86_64,下载完毕后将其解压,得到一个“android-ndk-r16b”文件夹,将其内部的所有文件全部移动至“/home/davidhopper/Android/Sdk/ndk-bundle/”文件夹下,重启Android Studio,问题解决。
如有更好的方案请分享一下。
标签: NDK is missing a "platforms" directory
最后更新:2018年12月12日

daozi

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >
搜索
联系方式

QQ群:179730949
QQ群:114559024
欢迎您加入Android大家庭
本人QQ:136049925

赐我一丝安慰
给我一点鼓励

COPYRIGHT © 2023 魅力程序猿. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备15000477号