Hi,
this post is following this one (https://en.sfml-dev.org/forums/index.php?topic=24274.0), where I (unsuccessfully) tried to use SFML 2.5 for android. While waiting for a clear tutorial for SFML 2.5, I tried to compile SFML 2.4.2 for android this time, with the following command (run on windows 7 in SFML/build):
cmake -G"MinGW Makefiles" -DANDROID_ABI=armeabi -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=14 ..
Output:
CMake Error at cmake/toolchains/android.toolchain.cmake:807 (message):
Specified Android API level (14) does not match to the level found ().
Probably your copy of NDK is broken.
Call Stack (most recent call first):
build/CMakeFiles/3.9.1/CMakeSystem.cmake:6 (include)
CMakeLists.txt:40 (project)
I searched on google and nothing is really clear about that, all I can find is "you should add -DANDROID_NATIVE_API_LEVEL=14", but when I add this, it changes nothing. I also tried to manually change some parameters in the files cmake creates, or delete them to restart from scratch, ... It changes nothing
So, how can I make it works?
I restarted without the android.toolchain.cmake, with the command:
cmake -G"MinGW Makefiles" -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=%ANDROID_NDK% -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=14 ..
I've had some errors but this post (https://en.sfml-dev.org/forums/index.php?topic=22617.0) helped me. I built SFML 2.4.2 for android, it created some .so files in the build/lib folder. Now, I try to build the android sample with:
ndk-build APP_BUILD_SCRIPT="Android.mk" NDK_APPLICATION_MK="Application.mk" NDK_PROJECT_PATH=. NDK_MODULE_PATH="PATH_TO_MY_SFML/build"
(run in the folder "android/jni")
But I get the following error:
Android NDK: Android.mk: Cannot find module with tag 'sfml' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
Android.mk:18: *** Android NDK: Aborting. . Stop.
It specify that it searches an empty directory name, but why?
EDIT : solved, I just forgot to do "mingw32-make -install"