Hi there!
I am trying to build Android application on Windows 10, basically performing steps described in this tutorial:
https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android-on-Windows.
When I used the command
cmake -G "MinGW Makefiles" -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/android.toolchain.cmake ../..
I got the following error:
CMake Error at cmake/toolchains/android.toolchain.cmake:802 (message):
Specified Android native API level 'android-8' is not supported by your
NDK/toolchain.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/CMakeDetermineSystem.cmake:95 (include)
CMakeLists.txt:47 (project)
So I have added an extra option, -DANDROID_NATIVE_API_LEVEL=android-21 (which corresponds to the API level mentioned in the tutorial).
Now, while using the command
cmake -G "MinGW Makefiles" -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=android-21 -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/android.toolchain.cmake ../..
I get the following error:
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindOpenAL.cmake:101 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/SFML/Audio/CMakeLists.txt:76 (find_package)
Could anyone help please?
UpdateJust in case I added some logging into the Audio module CMakeList.txt before the if block the line 76 belongs to:
***** SFML_OS_ANDROID: 1
***** CMAKE_INCLUDE_PATH: C:/Users/Dmitry/projects/sfml/extlibs/headers;C:/Users/Dmitry/projects/sfml/extlibs/headers/AL;C:/Users/Dmitry/projects/sfml/extlibs/android
Then I added some logging into C:\Users\Dmitry\projects\sfml\src\SFML\CMakeLists.txt:
elseif(SFML_OS_ANDROID)
message("***** CMAKE_ANDROID_ARCH_ABI: ${CMAKE_ANDROID_ARCH_ABI}")
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-android/${CMAKE_ANDROID_ARCH_ABI}")
endif()
and got
***** CMAKE_LIBRARY_PATH: C:/Users/Dmitry/projects/sfml/extlibs/libs-android/
***** CMAKE_ANDROID_ARCH_ABI:
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindOpenAL.cmake:96 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/SFML/Audio/CMakeLists.txt:76 (find_package)
It looks like CMAKE_ANDROID_ARCH_ABI does not add the required suffix "armeabi-v7a" to the path.
Unfortunately, putting ANDROID_NDK_ABI_NAME instead does not solve the issue either:
***** CMAKE_LIBRARY_PATH: C:/Users/Dmitry/projects/sfml/extlibs/libs-android/armeabi-v7a
***** CMAKE_ANDROID_ARCH_ABI:
***** ANDROID_NDK_ABI_NAME: armeabi-v7a
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/FindOpenAL.cmake:96 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/SFML/Audio/CMakeLists.txt:76 (find_package)