Android Studio: сбой команды сборки - PullRequest
0 голосов
/ 29 мая 2018

Я установил Android Studio 3.1.2 и создаю приложение My application, но оно говорит следующее:

Build command failed.
Error while executing process C:\Users\Rajeev Sarraf\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Rajeev Sarraf\ApkProjects\MyApplication\app -BC:\Users\Rajeev Sarraf\ApkProjects\MyApplication\app\.externalNativeBuild\cmake\release\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Rajeev Sarraf\ApkProjects\MyApplication\app\build\intermediates\cmake\release\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\Rajeev Sarraf\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=C:\Users\Rajeev Sarraf\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Rajeev Sarraf\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}


-- Check for working C compiler: C:/Users/Rajeev Sarraf/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe


-- Check for working C compiler: C:/Users/Rajeev Sarraf/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken


/Users/Rajeev   Sarraf/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"   is not able to compile a simple test program. 
Open File


  It fails with the following output:


   Change Dir: C:/Users/Rajeev Sarraf/ApkProjects/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeTmp


  Run Build Command:"C:/Users/Rajeev


  Sarraf/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"


  "cmTC_c2a5a"


  [1/2] Building C object CMakeFiles/cmTC_c2a5a.dir/testCCompiler.c.o


  FAILED:


  C:\Users\RAJEEV~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/Rajeev


  Sarraf/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"


  --sysroot="C:/Users/Rajeev


  Sarraf/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem


  C:/Users/Rajeev


  Sarraf/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_c2a5a.dir/testCCompiler.c.o -c


  "C:\Users\Rajeev


  Sarraf\ApkProjects\MyApplication\app\.externalNativeBuild\cmake\release\armeabi-v7a\CMakeFiles\CMakeTmp\testCCompiler.c"


error: no such file or directory:


  'Sarraf/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/Rajeev Sarraf/ApkProjects/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeOutput.log".


See also "C:/Users/Rajeev Sarraf/ApkProjects/MyApplication/app/.externalNativeBuild/cmake/release/armeabi-v7a/CMakeFiles/CMakeError.log".


Build command failed.


Error while executing process C:\Users\Rajeev Sarraf\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\Rajeev Sarraf\ApkProjects\MyApplication\app -BC:\Users\Rajeev Sarraf\ApkProjects\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-15 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Rajeev Sarraf\ApkProjects\MyApplication\app\build\intermediates\cmake\debug\obj\armeabi-v7a -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\Rajeev Sarraf\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_CXX_FLAGS= -DCMAKE_TOOLCHAIN_FILE=C:\Users\Rajeev Sarraf\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\Rajeev Sarraf\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}


-- Check for working C compiler: C:/Users/Rajeev Sarraf/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe


-- Check for working C compiler: C:/Users/Rajeev Sarraf/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken


/Users/Rajeev   Sarraf/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"   is not able to compile a simple test program. 
Open File


  It fails with the following output:


   Change Dir: C:/Users/Rajeev Sarraf/ApkProjects/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeTmp


  Run Build Command:"C:/Users/Rajeev


  Sarraf/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"


  "cmTC_f8247"


  [1/2] Building C object CMakeFiles/cmTC_f8247.dir/testCCompiler.c.o


  FAILED:


  C:\Users\RAJEEV~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/Rajeev


  Sarraf/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"


  --sysroot="C:/Users/Rajeev


  Sarraf/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem


  C:/Users/Rajeev


  Sarraf/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_f8247.dir/testCCompiler.c.o -c


  "C:\Users\Rajeev


  Sarraf\ApkProjects\MyApplication\app\.externalNativeBuild\cmake\debug\armeabi-v7a\CMakeFiles\CMakeTmp\testCCompiler.c"


error: no such file or directory:


  'Sarraf/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/Rajeev Sarraf/ApkProjects/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeOutput.log".


See also "C:/Users/Rajeev Sarraf/ApkProjects/MyApplication/app/.externalNativeBuild/cmake/debug/armeabi-v7a/CMakeFiles/CMakeError.log".

В нем говорится о 4 ошибках, которые может дать любой желающий.

1 Ответ

0 голосов
/ 21 июня 2018

У меня была такая же проблема.Я надеюсь, что смогу помочь тебе здесь.Попробуйте создать новый проект и изменить местоположение проекта.Важно, чтобы в новом проекте не было пробелов.Gradle не может синхронизироваться, если есть пробелы.

Жюль

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...