Closed songjiachao closed 1 month ago
Hello again!
There's is a known issue with NDK r27. This was discussed in a previous issue here.
However, in this case the problem is indicated by this line:
...
CMake Error at /Users/vivo/Library/Android/sdk/cmake/3.30.4/share/cmake-3.30/Modules/Platform/Android-Determine.cmake:218 (message):
Android: Neither the NDK or a standalone toolchain was found.
...
You can see the logic that generates this error message here:
...
if(NOT CMAKE_ANDROID_NDK AND NOT CMAKE_ANDROID_STANDALONE_TOOLCHAIN)
message(FATAL_ERROR "Android: Neither the NDK or a standalone toolchain was found.")
endif()
...
So CMake was not able to identify the NDK or toolchain. A few lines above that, you can see which environment variables CMake uses to locate these:
...
elseif(IS_DIRECTORY "$ENV{ANDROID_NDK_ROOT}")
file(TO_CMAKE_PATH "$ENV{ANDROID_NDK_ROOT}" CMAKE_ANDROID_NDK)
elseif(IS_DIRECTORY "$ENV{ANDROID_NDK}")
file(TO_CMAKE_PATH "$ENV{ANDROID_NDK}" CMAKE_ANDROID_NDK)
elseif(IS_DIRECTORY "$ENV{ANDROID_STANDALONE_TOOLCHAIN}")
file(TO_CMAKE_PATH "$ENV{ANDROID_STANDALONE_TOOLCHAIN}" CMAKE_ANDROID_STANDALONE_TOOLCHAIN)
endif()
...
You might be able to fix this by setting (and exporting) ANDROID_NDK_ROOT
or ANDROID_NDK
to the location of the NDK in your build environment.
I hope this resolves your build issue!
Problem:
When I use ndk 27.0.11902837 got error
but use 28.0.12433566 success