m
14d ago

echo 'NDK_PATH is unset, should be somewhere like /Users/<username>/Library/Android/sdk/ndk/r25b'

HI,

I cloned on Win 11 Android studio Iguana | 2023.2.1 Patch 2 Android example from https://github.com/rive-app/rive-android.git but I am not able to build it because of error

echo 'NDK_PATH is unset, should be somewhere like /Users/<username>/Library/Android/sdk/ndk/r25b'

I tried to add

ndkVersion "25.1.8937393"

ndkPath "c:/sdk/ndk/25.1.8937393"

into build.gradle but did not helped.

Below is full listing

C++ build system [configure] failed while executing:
    @echo off
    "C:\\sdk\\cmake\\3.22.1\\bin\\cmake.exe" ^
      "-HC:\\Users\\pober\\AndroidStudioProjects\\rive\\kotlin\\src\\main\\cpp" ^
      "-DCMAKE_SYSTEM_NAME=Android" ^
      "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^
      "-DCMAKE_SYSTEM_VERSION=21" ^
      "-DANDROID_PLATFORM=android-21" ^
      "-DANDROID_ABI=x86" ^
      "-DCMAKE_ANDROID_ARCH_ABI=x86" ^
      "-DANDROID_NDK=c:\\sdk\\ndk\\25.1.8937393" ^
      "-DCMAKE_ANDROID_NDK=c:\\sdk\\ndk\\25.1.8937393" ^
      "-DCMAKE_TOOLCHAIN_FILE=c:\\sdk\\ndk\\25.1.8937393\\build\\cmake\\android.toolchain.cmake" ^
      "-DCMAKE_MAKE_PROGRAM=C:\\sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
      "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\pober\\AndroidStudioProjects\\rive\\kotlin\\build\\intermediates\\cxx\\Debug\\4h3l715i\\obj\\x86" ^
      "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:\\Users\\pober\\AndroidStudioProjects\\rive\\kotlin\\build\\intermediates\\cxx\\Debug\\4h3l715i\\obj\\x86" ^
      "-DCMAKE_BUILD_TYPE=Debug" ^
      "-BC:\\Users\\pober\\AndroidStudioProjects\\rive\\kotlin\\.cxx\\Debug\\4h3l715i\\x86" ^
      -GNinja ^
      "-DCMAKE_VERBOSE_MAKEFILE=1" ^
      "-DANDROID_ALLOW_UNDEFINED_SYMBOLS=ON" ^
      "-DANDROID_CPP_FEATURES=no-exceptions no-rtti" ^
      "-DANDROID_STL=c++_shared"
  from C:\Users\pober\AndroidStudioProjects\rive\kotlin
BUILD TYPE: Debug
Skia location: skia_debug
+ ARCH_X86=x86
+ ARCH_X64=x86_64
+ ARCH_ARM=armeabi-v7a
+ ARCH_ARM64=arm64-v8a
+ ONLY_DEPS=true
+ NEEDS_CLEAN=false
+ FLAGS='-flto=full -DNDEBUG'
+ CONFIG=release
+ CONFIG_SKIA_REPO=https://github.com/rive-app/skia
+ CONFIG_SKIA_BRANCH=rive
+ CONFIG_SKIA_DIR_NAME=skia
+ [[ linux-gnu == \l\i\n\u\x\-\g\n\u* ]]
+ HOST_TAG=linux-x86_64
+ '[' -z linux-x86_64 ']'
+ getopts a:cbdl opt
+ case "$opt" in
+ ARCH_NAME=x86
+ getopts a:cbdl opt
+ case "$opt" in
+ ONLY_DEPS=false
+ getopts a:cbdl opt
+ case "$opt" in
+ CONFIG=debug
+ FLAGS='-DDEBUG -g'
+ CONFIG_SKIA_REPO=https://github.com/google/skia
+ CONFIG_SKIA_BRANCH=chrome/m105
+ CONFIG_SKIA_DIR_NAME=skia_debug
+ getopts a:cbdl opt
+ '[' -z x86 ']'
+ [[ linux-gnu == \d\a\r\w\i\n* ]]
++ tr -d ' \t\n\r'
+ EXPECTED_NDK_VERSION=r25b
+ [[ -z '' ]]
+ echo 'NDK_PATH is unset, should be somewhere like /Users/<username>/Library/Android/sdk/ndk/r25b'
+ exit 1
CMake Error at CMakeLists.txt:65 (message):
  Script returned with error: '' - '1' : com.android.ide.common.process.ProcessException: -- The CXX compiler identification is Clang 14.0.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!
See also "C:/Users/pober/AndroidStudioProjects/rive/kotlin/.cxx/Debug/4h3l715i/x86/CMakeFiles/CMakeOutput.log".
1 reply
P
P
13d ago

Hi . Please do the following:

1. Make sure Android NDK is installed (https://developer.android.com/studio/projects/install-ndk#specific-version)
2. Find the path to the NDK (on Windows 11 it should be something like C:\Users\{username}\AppData\Local\Android\Sdk\ndk\25.1.8937393)
3. Add NDK_PATH (using the path from step 2) to your environment variables (https://www.anoopcnair.com/set-up-environment-variables-on-windows-11/)
4. Build