我已经尝试了几天将NDK安装到Android Studio中,但它总是给我一条错误消息,说明构建失败了,我应该安装一个c编译器。我通过检查NDK和C Make来通过SDK Manager安装了NDK。
我已经尝试完全重新安装Android Studio和NDK,但是这样做并没有 - 同样的错误。 值得一提的是,如果我在项目创建期间没有检查C ++支持,则没有错误(但也没有c ++支持:D)。
我该怎么办,因为它会杀死我的工作流程?
非常感谢
错误讯息:
块引用 外部本机构建问题 构建命令失败。 执行进程C:\ Users \ Julius Debus \ AppData \ Local \ Android \ Sdk \ cmake \ 3.6.4111459 \ bin \ cmake.exe时出错,参数为{-HC:\ Users \ Julius Debus \ Desktop \ MyApplication \ app -BC :\ Users \ Julius Debus \ Desktop \ MyApplication \ app.externalNativeBuild \ cmake \ release \ armeabi-v7a -DANDROID_ABI = armeabi-v7a -DANDROID_PLATFORM = android-21 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY = C:\ Users \ Julius Debus \ Desktop \ MyApplication \ app \ build \ intermediates \ cmake \ release \ obj \ armeabi-v7a -DCMAKE_BUILD_TYPE = Release -DANDROID_NDK = C:\ Users \ Julius Debus \ AppData \ Local \ Android \ Sdk \ ndk-bundle -DCMAKE_CXX_FLAGS = -std = c ++ 11 -frtti -fexceptions -DCMAKE_TOOLCHAIN_FILE = C:\ Users \ Julius Debus \ AppData \ Local \ Android \ Sdk \ ndk-bundle \ build \ cmake \ android.toolchain.cmake -DCMAKE_MAKE_PROGRAM = C:\ Users \ Julius Debus \ AppData \ Local \ Android \ Sdk \ cmake \ 3.6.4111459 \ bin \ ninja.exe -GAndroid Gradle - Ninja} - 检查工作C编译器:C:/ Users / Julius Debus / AppData / Local / Android / Sdk / ndk-bundle / toolchains / llvm / prebuilt / windows-x86_64 / bin / clang.exe - 检查工作C编译器:C:/ Users / Julius Debus / AppData / Local / Android / Sdk / ndk-bundle / toolchains / llvm / prebuilt / windows-x86_64 / bin / clang.exe - broken 它失败并带有以下输出: 更改目录:C:/ Users / Julius Debus / Desktop / MyApplication / app / .externalNativeBuild / cmake / release / armeabi-v7a / CMakeFiles / CMakeTmp 运行Build命令:" C:/ Users / Julius Debus /应用程序数据/本地/ Android设备/ SDK / cmake的/ 3.6.4111459 / bin中/ ninja.exe" " cmTC_a4b3d" [1/2]构建C对象CMakeFiles / cmTC_a4b3d.dir / testCCompiler.c.o 失败: C:\用户\ JULIUS〜1 \应用程序数据\本地\的Android \ SDK \ NDK-BU〜1个\ TOOLCH〜1 \ LLVM \预建\ WINDOW〜1个\ BIN \ clang.exe --target = armv7-none-linux-androideabi --gcc-toolchain =" C:/ Users / Julius Debus /应用程序数据/本地/ Android设备/ SDK / NDK束/工具链/臂-Linux的androideabi-4.9 /预建/窗口-x86_64的" --sysroot =" C:/用户/朱利 Debus /应用程序数据/本地/ Android设备/ SDK / NDK束/ SYSROOT" -isystem C:/用户/朱利叶斯 Debus /应用程序数据/本地/ Android设备/ SDK / NDK束/ SYSROOT的/ usr /包括/臂-Linux的androideabi -D__ANDROID_API __ = 21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march = armv7-a -mfloat-abi = softfp -mfpu = vfpv3-d16 -fno-integrated-as -mthumb -Wa, - noexecstack -Wformat -Werror = format-security -fPIE -o CMakeFiles / cmTC_a4b3d.dir / testCCompiler.c.o -c" C:\ Users \ Julius Debus \桌面\ MyApplication的\ app.externalNativeBuild \ cmake的\释放\ armeabi-V7A \ CMakeFiles \ CMakeTmp \ testCCompiler.c" 错误:错误:错误:没有这样的文件或目录: ' Debus /应用程序数据/本地/ Android设备/ SDK / NDK束/ SYSROOT的/ usr /包括/臂-Linux的androideabi'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/Users/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeError.log".
Build command failed.
Error while executing process C:\Users\Julius Debus\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Julius Debus\Desktop\MyApplication\app -BC:\Users\Julius Debus\Desktop\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-21 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Julius Debus\Desktop\MyApplication\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\Julius Debus\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions -DCMAKE_TOOLCHAIN_FILE=C:\Users\Julius Debus\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Julius Debus\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/Julius Debus/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/Julius Debus/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
It fails with the following output:
Change Dir: C:/Users/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/Julius
Debus/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"
"cmTC_82ebe"
[1/2] Building C object CMakeFiles/cmTC_82ebe.dir/testCCompiler.c.o
FAILED:
C:\Users\JULIUS~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
--target=armv7-none-linux-androideabi --gcc-toolchain="C:/Users/Julius
Debus/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/Julius
Debus/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem
C:/Users/Julius
Debus/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv7-a
-mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb
-Wa,--noexecstack -Wformat -Werror=format-security -fPIE -o
CMakeFiles/cmTC_82ebe.dir/testCCompiler.c.o -c "C:\Users\Julius
Debus\Desktop\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a\CMakeFiles\CMakeTmp\testCCompiler.c"
Error:Error:error: no such file or directory:
'Debus/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
-- Configuring incomplete, errors occurred!
See also "C:/Users/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Julius Debus/Desktop/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeError.log".
C:\ Users \ Julius Debus \ AppData \ Local \ Android \ Sdk \ ndk-bundle \ build \ cmake \ android.toolchain.cmake 警告:警告:第(63)行(包含)CMakeLists.txt 警告:警告:第(63)行(包含)CMakeLists.txt C:\ Users \ Julius Debus \ AppData \ Local \ Android \ Sdk \ cmake \ 3.6.4111459 \ share \ cmake-3.6 \ Modules \ CMakeTestCCompiler.cmake 错误:错误:第(61)行/用户/ Julius Debus / AppData / Local / Android / Sdk / ndk-bundle / toolchains / llvm / prebuilt / windows-x86_64 / bin / clang.exe"无法编译简单的测试程序。 打开文件 错误:错误:第(61)行/用户/ Julius Debus / AppData / Local / Android / Sdk / ndk-bundle / toolchains / llvm / prebuilt / windows-x86_64 / bin / clang.exe"无法编译简单的测试程序。 打开文件