构建命令失败
Posted
技术标签:
【中文标题】构建命令失败【英文标题】:Build command failed 【发布时间】:2018-02-18 05:45:02 【问题描述】:我使用 android studio preview beta 4,当我打开它构建的项目时,我从 https://github.com/DrKLO/Telegram 获取 Telegram 源代码并收到此错误:
。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-23 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/armv7_SDK23/debug/obj NDK_LIBS_OUT=C:\Users\M \Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\armv7_SDK23\debug\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=0 APP_PLATFORM =android-16 NDK_OUT=C:/Users/M/Desktop/app 源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/x86/release/obj NDK_LIBS_OUT=C:\Users\M\Desktop\app源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\x86\release\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=0 APP_PLATFORM =android-16 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/x86/foss/obj NDK_LIBS_OUT=C:\Users\M\Desktop\app源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\x86\foss\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM =android-16 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/fat/debug/obj NDK_LIBS_OUT=C:\Users\M\Desktop\app源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\fat\debug\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/armv7/foss/obj NDK_LIBS_OUT=C:\Users\M \Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\armv7\foss\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM =android-23 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/x86_SDK23/debug/obj NDK_LIBS_OUT=C:\Users\M\Desktop\app源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\x86_SDK23\debug\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-23 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/armv7_SDK23/release/obj NDK_LIBS_OUT=C:\Users\M \Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\armv7_SDK23\release\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=0 APP_PLATFORM =android-23 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/x86_SDK23/release/obj NDK_LIBS_OUT=C:\Users\M\Desktop\app源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\x86_SDK23\release\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=0 APP_PLATFORM =android-16 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/fat/foss/obj NDK_LIBS_OUT=C:\Users\M\Desktop\app源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\fat\foss\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-23 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/armv7_SDK23/foss/obj NDK_LIBS_OUT=C:\Users\M \Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\armv7_SDK23\foss\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=0 APP_PLATFORM =android-23 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/x86_SDK23/foss/obj NDK_LIBS_OUT=C:\Users\M\Desktop\app源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\x86_SDK23\foss\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM =android-16 NDK_OUT=C:/Users/M/Desktop/app 源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/x86/debug/obj NDK_LIBS_OUT=C:\Users\M\Desktop\app源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\x86\debug\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/armv7/release/obj NDK_LIBS_OUT=C:\Users\M \Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\armv7\release\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/armv7/debug/obj NDK_LIBS_OUT=C:\Users\M \Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\armv7\debug\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 。 使用参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\M\Desktop\app source code\Telegram 执行进程 C:\Users\M\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd 时出错-FOSS-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\M\Desktop\app 源代码\Telegram-FOSS-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=0 APP_PLATFORM =android-16 NDK_OUT=C:/Users/M/Desktop/app源代码/Telegram-FOSS-master/TMessagesProj/build/intermediates/ndkBuild/fat/release/obj NDK_LIBS_OUT=C:\Users\M\Desktop\app源代码\Telegram-FOSS-master\TMessagesProj\build\intermediates\ndkBuild\fat\release\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n Android NDK:您的 APP_BUILD_SCRIPT 指向一个未知文件:C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj\jni\Android.mk process_begin: CreateProcess(NULL, "", ...) 失败。 C:\Users\M\AppData\Local\Android\sdk\ndk-bundle\build\core\add-application.mk 错误:(183, 0) * Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) Android NDK: Aborting... 。停止。 打开文件 错误:(183, 0) * Android NDK: Aborting... .停止。 打开文件 错误:(183, 0) *** Android NDK: Aborting... .停止。 打开文件
我使用最新的 NDK android-ndk-r16-beta1-windows-x86 。 错误在 add-application.mk 的第 100 行,它是:
ifndef _build_script
$(call __ndk_info,Your APP_BUILD_SCRIPT points to an unknown file:
$(APP_BUILD_SCRIPT))
$(call __ndk_error,Aborting...)
endif
所以我使用的 add-application.mk 在这个 URL 中: https://android.googlesource.com/platform/ndk/+/froyo/build/core/add-application.mk
【问题讨论】:
【参考方案1】:您在C:\Users\M\Desktop\app source code\Telegram-FOSS-master\TMessagesProj
中放置的项目有空格。这不适用于 NDK。将您的项目移动到没有空格的路径。
【讨论】:
感谢重播,我更改了名称并删除了空间,但错误仍然存在。 ndk-bundle\ndk-build.cmd 带参数 NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=Telegram-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=Telegram-master\TMessagesProj\jni\Application.mk APP_ABI =x86 NDK_ALL_ABIS=x86 NDK_DEBUG=0 APP_PLATFORM=android-16 NDK_OUT=apps/Telegram-master/TMessagesProj/build/intermediates/ndkBuild/x86/foss/obj NDK_LIBS_OUT=apps\Telegram-master\TMessagesProj\build\intermediates\ndkBuild\ x86\foss\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n process_begin: CreateProcess(NULL, "", ...) 这是一个很长的错误,但评论限制在600个字符。 您可以编辑您的问题;您也可以将日志复制到 pastebin 并在此处放置链接。您发布的片段没有包含足够的信息。 也许您没有清理build
和.externalNativeBuild
目录?以上是关于构建命令失败的主要内容,如果未能解决你的问题,请参考以下文章
构建步骤“执行 Windows 批处理命令”将构建标记为失败已完成:失败