1
General discussions / [Solved] How to build SFML3 with gradlew for Android on Window 10 with MinGW?
« on: January 03, 2024, 08:26:04 pm »
Hello,
I will continue here my previous topic: SFML 2.6, building Android, MinGW: A problem occurred evaluating project ':app'. But I will use SFML3.
My steps:
Log:
I will describe my steps from scratch.
I used Qt installer to install MinGW and Qt Creator IDE to install Android SDK Manager, CMake, Ninja and JDK. Qt is free and open source C++ framework to develop for Android, iOS, Desktop, Web (with WebAssembly) and so on.
Qt installer:
I will continue here my previous topic: SFML 2.6, building Android, MinGW: A problem occurred evaluating project ':app'. But I will use SFML3.
My steps:
- I downloaded SFML-master
- I moved to `SFML-master\examples\android`in CMD
- I entered this command: `gradlew assembleDebug`
Log:
Quote
E:\Libs\SFML-master\examples\android>gradlew assembleDebug
> Task :app:configureCMakeDebug[arm64-v8a] FAILED
C/C++: CMake Error at CMakeLists.txt:10 (find_package):
C/C++: By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
C/C++: asked CMake to find a package configuration file provided by "SFML", but
C/C++: CMake did not find one.
C/C++: Could not find a package configuration file provided by "SFML" (requested
C/C++: version 3) with any of the following names:
C/C++: SFMLConfig.cmake
C/C++: sfml-config.cmake
C/C++: Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
C/C++: "SFML_DIR" to a directory containing one of the above files. If "SFML"
C/C++: provides a separate development package or SDK, be sure it has been
C/C++: installed.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:configureCMakeDebug[arm64-v8a]'.
> [CXX1429] error when building with cmake using E:\Libs\SFML-master\examples\android\app\src\main\jni\CMakeLists.txt: -- The CXX compiler identification is Clang 17.0.2
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: E:/AppData/Android/SDK/ndk/26.1.10909125/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 "E:/Libs/SFML-master/examples/android/app/.cxx/Debug/2305a5j6/arm64-v8a/CMakeFiles/CMakeOutput.log".
C++ build system [configure] failed while executing:
@echo off
"E:\\AppData\\Android\\SDK\\cmake\\3.22.1\\bin\\cmake.exe" ^
"-HE:\\Libs\\SFML-master\\examples\\android\\app\\src\\main\\jni" ^
"-DCMAKE_SYSTEM_NAME=Android" ^
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^
"-DCMAKE_SYSTEM_VERSION=21" ^
"-DANDROID_PLATFORM=android-21" ^
"-DANDROID_ABI=arm64-v8a" ^
"-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" ^
"-DANDROID_NDK=E:\\AppData\\Android\\SDK\\ndk\\26.1.10909125" ^
"-DCMAKE_ANDROID_NDK=E:\\AppData\\Android\\SDK\\ndk\\26.1.10909125" ^
"-DCMAKE_TOOLCHAIN_FILE=E:\\AppData\\Android\\SDK\\ndk\\26.1.10909125\\build\\cmake\\android.toolchain.cmake" ^
"-DCMAKE_MAKE_PROGRAM=E:\\AppData\\Android\\SDK\\cmake\\3.22.1\\bin\\ninja.exe" ^
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=E:\\Libs\\SFML-master\\examples\\android\\app\\build\\intermediates\\cxx\\Debug\\2305a5j6\\obj\\arm64-v8a" ^
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=E:\\Libs\\SFML-master\\examples\\android\\app\\build\\intermediates\\cxx\\Debug\\2305a5j6\\obj\\arm64-v8a" ^
"-DCMAKE_BUILD_TYPE=Debug" ^
"-BE:\\Libs\\SFML-master\\examples\\android\\app\\.cxx\\Debug\\2305a5j6\\arm64-v8a" ^
-GNinja ^
"-DANDROID_STL=c++_shared" ^
"-DSFML_STATIC_LIBRARIES=FALSE"
from E:\Libs\SFML-master\examples\android\app
CMake Error at CMakeLists.txt:10 (find_package):
By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SFML", but
CMake did not find one.
Could not find a package configuration file provided by "SFML" (requested
version 3) with any of the following names:
SFMLConfig.cmake
sfml-config.cmake
Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
"SFML_DIR" to a directory containing one of the above files. If "SFML"
provides a separate development package or SDK, be sure it has been
installed.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 57s
20 actionable tasks: 20 executed
I will describe my steps from scratch.
I used Qt installer to install MinGW and Qt Creator IDE to install Android SDK Manager, CMake, Ninja and JDK. Qt is free and open source C++ framework to develop for Android, iOS, Desktop, Web (with WebAssembly) and so on.
Qt installer: