execution failed for task #39;:app:compileDebugNdk#39; failed to run this command ndk-build.cmd(任务:app:compileDebugNdk的执行失败无法运行此命令ndk-build.cmd)
问题描述
<块引用>
com.android.ide.common.internal.LoggedErrorException:无法运行命令:C:Program FilesADTsdkandroid-ndk dk-build.cmd NDK_PROJECT_PATH=null
这是我在 android studio 上尝试对我的项目运行 make 时得到的输出.我在安卓工作室 1.0sdk 构建工具 24.0,但针对 API 14
这就是我的 Android.mk 文件的样子
这就是我的 application.mk 文件的样子
Error:Execution failed for task ':app:compileDebugNdk'.
表示 gradle android 插件正在尝试调用 ndk-build 本身来编译您的源代码.您应该在日志窗口中获得比错误代码更多的详细信息.
无论如何,目前它使用自动生成的 Makefile 执行此操作并忽略您的,因为您需要集成 ffmpeg,因此无法正常工作.
要克服这个问题,您应该禁用插件的自动 ndk 集成,并使其使用标准 libs 位置来获取您的 .so 文件:
从那里你可以自己调用 ndk-build,或者让 gradle 为你调用它:
有关为什么这一切的更多信息,您可以查看此 gist 和我的 博文.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:Program FilesADTsdkandroid-ndk dk-build.cmd NDK_PROJECT_PATH=null
this is the output I get when trying to run a make on my project on android studio. I'm on android studio 1.0 sdk build tools 24.0 but targeting API 14
this is what my Android.mk file looks like
this is what my application.mk file looks like
Error:Execution failed for task ':app:compileDebugNdk'.
means that the gradle android plugin is trying to call ndk-build itself to compile your sources. You should get more details than the error code in your log window.
Anyway, currently it does this using an auto-generated Makefile and ignores yours, which can't work since you need to integrate ffmpeg.
To overcome this, you should disable the plugin's automatic ndk integration and make it use the standard libs location to get your .so files:
from there you can call ndk-build yourself, or make gradle call it for you:
For more information on why all this, you can check this gist and my blog post.
这篇关于任务':app:compileDebugNdk'的执行失败无法运行此命令ndk-build.cmd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!