Search code examples
androidandroid-studio-3.0

Android Studio: External Native Build Issues


I cloned a project from a github repository and opened it in my Android Studio 3.0.

As soon as I open up Android Studio I get an Error:

Cannot load module file 'C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\Bookingtest.iml':
File C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\Bookingtest.iml does not exist

Would you like to remove module 'Bookingtest' from the project?

I don't understand why a file doesn't exist when I cloned the project right from the github.

Another Error that come up with the Gradle Sync is and External Native Build Issue.

External Native Build Issues
    Build command failed.
    Error while executing process C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app -BC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\release\armeabi -DANDROID_ABI=armeabi -DANDROID_PLATFORM=android-16 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\build\intermediates\cmake\release\obj\armeabi -DCMAKE_BUILD_TYPE=Release -DANDROID_NDK=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_TOOLCHAIN_FILE=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
    -- Check for working C compiler: C:/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
    -- Check for working C compiler: C:/Users/David Ferrara/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/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeTmp
      Run Build Command:"C:/Users/David
      Ferrara/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"
      "cmTC_93f60"
      [1/2] Building C object CMakeFiles/cmTC_93f60.dir/testCCompiler.c.o
      FAILED:
      C:\Users\DAVIDF~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
      --target=armv5te-none-linux-androideabi --gcc-toolchain="C:/Users/David
      Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
      --sysroot="C:/Users/David
      Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem
      C:/Users/David
      Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
      -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables
      -fstack-protector-strong -no-canonical-prefixes -march=armv5te
      -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack
      -Wformat -Werror=format-security -fPIE -o
      CMakeFiles/cmTC_93f60.dir/testCCompiler.c.o -c "C:\Users\David
      Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\release\armeabi\CMakeFiles\CMakeTmp\testCCompiler.c"
    Error:Error:error: no such file or directory:
      'Ferrara/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/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/release/armeabi/CMakeFiles/CMakeError.log".
    Build command failed.
    Error while executing process C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {-HC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app -BC:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\debug\armeabi -DANDROID_ABI=armeabi -DANDROID_PLATFORM=android-16 -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\David Ferrara\AndroidStudioProjects\ClBooking-master\app\build\intermediates\cmake\debug\obj\armeabi -DCMAKE_BUILD_TYPE=Debug -DANDROID_NDK=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle -DCMAKE_TOOLCHAIN_FILE=C:\Users\David Ferrara\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -GAndroid Gradle - Ninja}
    -- Check for working C compiler: C:/Users/David Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
    -- Check for working C compiler: C:/Users/David Ferrara/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/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeTmp
      Run Build Command:"C:/Users/David
      Ferrara/AppData/Local/Android/Sdk/cmake/3.6.4111459/bin/ninja.exe"
      "cmTC_17c6b"
      [1/2] Building C object CMakeFiles/cmTC_17c6b.dir/testCCompiler.c.o
      FAILED:
      C:\Users\DAVIDF~1\AppData\Local\Android\Sdk\NDK-BU~1\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.exe
      --target=armv5te-none-linux-androideabi --gcc-toolchain="C:/Users/David
      Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64"
      --sysroot="C:/Users/David
      Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot" -isystem
      C:/Users/David
      Ferrara/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
      -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables
      -fstack-protector-strong -no-canonical-prefixes -march=armv5te
      -mtune=xscale -msoft-float -fno-integrated-as -mthumb -Wa,--noexecstack
      -Wformat -Werror=format-security -fPIE -o
      CMakeFiles/cmTC_17c6b.dir/testCCompiler.c.o -c "C:\Users\David
      Ferrara\AndroidStudioProjects\ClBooking-master\app\.externalNativeBuild\cmake\debug\armeabi\CMakeFiles\CMakeTmp\testCCompiler.c"
    Error:Error:error: no such file or directory:
      'Ferrara/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/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/David Ferrara/AndroidStudioProjects/ClBooking-master/app/.externalNativeBuild/cmake/debug/armeabi/CMakeFiles/CMakeError.log".
C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\share\cmake-3.6\Modules\CMakeTestCCompiler.cmake
    Error:Error:line (61)/Users/David   Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"   is not able to compile a simple test program. 
<a href="openFile:C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\share\cmake-3.6\Modules\CMakeTestCCompiler.cmake">Open File</a>
    Error:Error:line (61)/Users/David   Ferrara/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"   is not able to compile a simple test program. 
<a href="openFile:C:\Users\David Ferrara\AppData\Local\Android\Sdk\cmake\3.6.4111459\share\cmake-3.6\Modules\CMakeTestCCompiler.cmake">Open File</a>

I've tired to search for answers on this subject and have come across some answers that are similar to my question except they are not solutions for my specific question.

I'm stuck at a wall and don't know what to do to resolve this Error. All I want to do is clone a repo from github and work on the project in Android studio. All of my SDKs are installed.


Solution

  • This may be caused by the space in the folder C:/Users/David Ferrara/AppData/Local/

    If so, it is likely a bug in Android Studio, CMake, or ninja