gpt4 book ai didi

java - 构建命令失败,外部 native 问题 android studio

转载 作者:行者123 更新时间:2023-11-30 02:19:01 25 4
gpt4 key购买 nike

我不明白 android studio 有什么问题,我是新制作的 android 应用程序,所以我真的不明白错误在哪里以及如何解决它。(如果您需要其他东西,请问我和我会把它)

这里是错误:

null 
Build command failed.
Error while executing process C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app -BC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\.externalNativeBuild\cmake\release\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/Raul del Rio/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/Raul del Rio/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
C:/Users/Raul del Rio/AndroidStudioProjects/MyApplication2
It fails with the following output:
Change Dir: C:/Users/Raul del Rio/AndroidStudioProjects/MyApplication2/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/Raul del
Rio/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe" "cmTC_48907"
[1/2] Building C object CMakeFiles/cmTC_48907.dir/testCCompiler.c.o
FAILED:
C:\Users\RAULDE~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/Raul del
Rio/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/Raul del
Rio/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem C:/Users/Raul
del
Rio/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=15 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv7-a
-mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat
-Werror=format-security -o CMakeFiles/cmTC_48907.dir/testCCompiler.c.o -c
"C:\Users\Raul del
Rio\AndroidStudioProjects\MyApplication2\app\.externalNativeBuild\cmake\release\armeabi-v7a\CMakeFiles\CMakeTmp\testCCompiler.c"
error: no such file or directory: 'del'

error: no such file or directory:
'Rio/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/Raul del Rio/AndroidStudioProjects/MyApplication2/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Raul del Rio/AndroidStudioProjects/MyApplication2/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeError.log".
Build command failed.
Error while executing process C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app -BC:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Raul del Rio\AndroidStudioProjects\MyApplication2\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Raul del Rio\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
-- Check for working C compiler: C:/Users/Raul del Rio/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Check for working C compiler: C:/Users/Raul del Rio/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/Raul del Rio/AndroidStudioProjects/MyApplication2/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp
Run Build Command:"C:/Users/Raul del
Rio/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe" "cmTC_405c9"
[1/2] Building C object CMakeFiles/cmTC_405c9.dir/testCCompiler.c.o
FAILED:
C:\Users\RAULDE~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/Raul del
Rio/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
--sysroot="C:/Users/Raul del
Rio/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem C:/Users/Raul
del
Rio/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-D__ANDROID_API__=15 -g -DANDROID -ffunction-sections -funwind-tables
-fstack-protector-strong -no-canonical-prefixes -march=armv7-a
-mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat
-Werror=format-security -o CMakeFiles/cmTC_405c9.dir/testCCompiler.c.o -c
"C:\Users\Raul del
Rio\AndroidStudioProjects\MyApplication2\app\.externalNativeBuild\cmake\debug\armeabi-v7a\CMakeFiles\CMakeTmp\testCCompiler.c"
error: no such file or directory: 'del'

error: no such file or directory:
'Rio/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/Raul del Rio/AndroidStudioProjects/MyApplication2/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Raul del Rio/AndroidStudioProjects/MyApplication2/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeError.log".

当我尝试编译以开始编程时,这就是我得到的结果。

最佳答案

尝试添加:

externalNativeBuild {
cmake {
arguments '-DBUILD_TESTING=OFF', '-DANDROID_TOOLCHAIN=gcc-4.9'
cppFlags "-std=c++14 -fexceptions -frtti"
}
}

build.gradle 中的 defaultConfig 中。这应该会让 Android Studio 使用默认的 gcc 工具链。

关于java - 构建命令失败,外部 native 问题 android studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51393677/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com