1

我不明白 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".   

当我试图编译开始编程时,这就是我得到的。

4

1 回答 1

3

尝试添加:

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

在你的defaultConfig在你的build.gradle。这应该使 Android Studio 使用默认的 gcc 工具链。

于 2018-07-18T05:01:13.037 回答