ARTICLE AD BOX
I've made a fresh install of Android Studio Otter 2 Feature Drop on Windows 10 and then installed the NDK and CMake using the SDK manager in Android Studio. However, I'm not able to build any of the NDK samples. When trying to do so I always get the following error:
[CXX1429] error when building with cmake using C:\Users\andreas\AndroidStudioProjects\NDK\base\src\main\cpp\CMakeLists.txt: -- The CXX compiler identification is Clang 19.0.1 -- Detecting CXX compiler ABI info -- Configuring incomplete, errors occurred! C++ build system [configure] failed while executing: @echo off "C:\\Users\\andreas\\AppData\\Local\\Android\\Sdk\\cmake\\4.1.0\\bin\\cmake.exe" ^ "-HC:\\Users\\andreas\\AndroidStudioProjects\\NDK\\base\\src\\main\\cpp" ^ "-DCMAKE_SYSTEM_NAME=Android" ^ "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^ "-DCMAKE_SYSTEM_VERSION=21" ^ "-DANDROID_PLATFORM=android-21" ^ "-DANDROID_ABI=x86_64" ^ "-DCMAKE_ANDROID_ARCH_ABI=x86_64" ^ "-DANDROID_NDK=C:\\Users\\andreas\\AppData\\Local\\Android\\Sdk\\ndk\\28.2.13676358" ^ "-DCMAKE_ANDROID_NDK=C:\\Users\\andreas\\AppData\\Local\\Android\\Sdk\\ndk\\28.2.13676358" ^ "-DCMAKE_TOOLCHAIN_FILE=C:\\Users\\andreas\\AppData\\Local\\Android\\Sdk\\ndk\\28.2.13676358\\build\\cmake\\android.toolchain.cmake" ^ "-DCMAKE_MAKE_PROGRAM=C:\\Users\\andreas\\AppData\\Local\\Android\\Sdk\\cmake\\4.1.0\\bin\\ninja.exe" ^ "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\andreas\\AndroidStudioProjects\\NDK\\base\\build\\intermediates\\cxx\\Debug\\5i6qz4i2\\obj\\x86_64" ^ "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:\\Users\\andreas\\AndroidStudioProjects\\NDK\\base\\build\\intermediates\\cxx\\Debug\\5i6qz4i2\\obj\\x86_64" ^ "-DCMAKE_BUILD_TYPE=Debug" ^ "-BC:\\Users\\andreas\\AndroidStudioProjects\\NDK\\base\\.cxx\\Debug\\5i6qz4i2\\x86_64" ^ -GNinja ^ "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" ^ "-DCMAKE_MODULE_PATH=C:\\Users\\andreas\\AndroidStudioProjects\\NDK\\cmake" from C:\Users\andreas\AndroidStudioProjects\NDK\base CMake Error at C:/Users/andreas/AndroidStudioProjects/NDK/base/.cxx/Debug/5i6qz4i2/x86_64/CMakeFiles/CMakeScratch/TryCompile-4tcqm5/CMakeLists.txt:2 (set): Syntax error in cmake code at C:/Users/andreas/AndroidStudioProjects/NDK/base/.cxx/Debug/5i6qz4i2/x86_64/CMakeFiles/CMakeScratch/TryCompile-4tcqm5/CMakeLists.txt:2 when parsing string C:\Users\andreas\AndroidStudioProjects\NDK\cmake Invalid character escape '\U'. CMake Error at C:/Users/andreas/AppData/Local/Android/Sdk/cmake/4.1.0/share/cmake-4.1/Modules/CMakeDetermineCompilerABI.cmake:83 (try_compile): Failed to configure test project build system.This looks like the error comes from the path C:\Users\andreas\AndroidStudioProjects\NDK\cmake where the backslashes are wrongly interpreted as escape codes. So I thought I can fix the issue by simply changing all backslashes to slashes in that path.
However, that's easier said than done because I have no idea where this path comes from. There is no cmake.dir in the local.properties and there are no CMake or Android environment variables either that could have somehow injected this path. So where does that path come from after all? It must come from Android Studio directly but this would mean that Android Studio is broken?
I mean, this is a fresh install of Android Studio Otter 2 and I haven't made any modifications whatsoever so shouldn't this just work right out of the box without requiring any modifications or fixes?
Does anyone have an idea how to fix this please?
