Distribution de travail : Lubuntu 22.04 LTS
Téléphone portable : Motorila 34G 5G
Android : 13
Liens :
https://wiki.minetest.net/Luanti_on_Android
https://github.com/minetest/minetest/blob/master/doc/android.md
util01@station40:~/ANDROID/LUANTI/luanti/android$ java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)
OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)
Lien : https://developer.android.com/studio
Version : 2024.2.1.10-linux
util01@station40:~/ANDROID$tar xvfz android-studio-2024.2.1.10-linux.tar.gz
util01@station40:~/ANDROID$ cd android-studio/bin/
util01@station40:~/ANDROID/android-studio/bin$ ./studio
Une fenêtre apparait pour valider le téléchargement du SDK Android.
Version : Android SDK Platform 34 (revision 3)
- [Tools][SDK Manager]
Name : Android 14.0 ("UpsideDownCake")
API Level : 34
Revision : 3
Installer la version API Level 29 : Android 10.0 ("Q")
https://dl.google.com/android/repository/platform-29_r05.zip
- NDK (Side by side)
- Android SDK Command-line Tools (latest)
- [Apply]
- [OK]
Cliquer sur [Show Packages Details], choisir la version du NDK : v.26.2.11394342
https://dl.google.com/android/repository/android-ndk-r26c-linux.zip
Après quelques minutes :
- Version du NDK installé : v.28.0.12433566 rc1
- Version du Command Line Tools : 12266719 / v.16.0
util01@station40:~/ANDROID/LUANTI/luanti/android$ ls -l /home/util01/Android/Sdk/ndk
total 8
drwxr-xr-x 11 util01 www-data 4096 oct. 28 22:18 26.2.11394342
drwxr-xr-x 11 util01 www-data 4096 oct. 27 20:44 28.0.12433566
Dans chacun des répertoires, le NDK est installé :
util01@station40:~/Android/Sdk/ndk$ ls 26.2.11394342/
build meta ndk-gdb ndk-stack NOTICE package.xml python-packages shader-tools source.properties toolchains
CHANGELOG.md ndk-build ndk-lldb ndk-which NOTICE.toolchain prebuilt README.md simpleperf sources wrap.sh
util01@station40:~/Android/Sdk/ndk$
util01@station40:~/Android/Sdk/ndk$ ls 28.0.12433566/
build meta ndk-gdb ndk-stack NOTICE package.xml python-packages shader-tools source.properties toolchains
CHANGELOG.md ndk-build ndk-lldb ndk-which NOTICE.toolchain prebuilt README.md simpleperf sources wrap.sh
util01@station40:~/Android/Sdk/ndk$
util01@station40:~/ANDROID/LUANTI/luanti/android$ export ANDROID_SDK_ROOT=/home/util01/Android/Sdk/
util01@station40:~$ mkdir -p ANDROID/LUANTI
util01@station40:~$ cd ANDROID/LUANTI/
util01@station40:~/ANDROID/LUANTI$
util01@station40:~/ANDROID/LUANTI$ wget https://github.com/minetest/minetest/archive/refs/tags/5.9.1.tar.gz
util01@station40:~/ANDROID/LUANTI$ tar xvfz 5.9.1.tar.gz
util01@station40:~/ANDROID/LUANTI$ mv minetest-5.9.1/ luanti
util01@station40:~/ANDROID/LUANTI$ cd luanti/lib/
util01@station40:~/ANDROID/LUANTI/luanti/lib$
util01@station40:~/ANDROID/LUANTI/luanti/lib$ wget https://github.com/minetest/irrlicht/archive/refs/tags/1.9.0mt15.tar.gz
util01@station40:~/ANDROID/LUANTI/luanti/lib$ tar xvfz 1.9.0mt15.tar.gz
util01@station40:~/ANDROID/LUANTI/luanti/lib$ mv irrlicht-1.9.0mt15/ irrlichtmt
util01@station40:~/ANDROID/LUANTI/luanti/lib$ cd ../android/
util01@station40:~/ANDROID/LUANTI/luanti/android$
Faire correspondre la version de Java avec la version SDL soit la version : 2.30.1
Ouvrir :
./android/app/src/main/java/org/libsdl/app/SDLActivity.java
Chercher :
private static final int SDL_MICRO_VERSION = 8;
Remplacer par :
private static final int SDL_MICRO_VERSION = 1;
Compiler la version en mode debug permet de faire une installation de Luanti sur Android sans problème de droit d'installation.
util01@station40:~/ANDROID/LUANTI/luanti/android$ ./gradlew assembledebug
Configuration on demand is an incubating feature.
> Task :native:downloadDeps
Download https://github.com/minetest/minetest_android_deps/releases/download/latest/deps-lite.zip
> Task :native:getDeps
Extracting to /home/util01/ANDROID/LUANTI/luanti/android/native/deps
> Task :app:prepareAssets
Preparing assets at build/assets
> Task :native:buildCMakeDebug[arm64-v8a]
C/C++: ninja: Entering directory `/home/util01/ANDROID/LUANTI/luanti/android/native/.cxx/Debug/f6q4w663/arm64-v8a'
C/C++: /home/util01/ANDROID/LUANTI/luanti/irr/src/os.cpp:167:48: warning: field precision should have type 'int', but argument has type 'size_t' (aka 'unsigned long') [-Wformat]
C/C++: __android_log_print(LogLevel, "Irrlicht", "%.*s\n", maxLogLen, &message[start]);
C/C++: ~~^~ ~~~~~~~~~
C/C++: 1 warning generated.
> Task :app:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :native:buildCMakeDebug[x86_64]
C/C++: ninja: Entering directory `/home/util01/ANDROID/LUANTI/luanti/android/native/.cxx/Debug/f6q4w663/x86_64'
C/C++: /home/util01/ANDROID/LUANTI/luanti/irr/src/os.cpp:167:48: warning: field precision should have type 'int', but argument has type 'size_t' (aka 'unsigned long') [-Wformat]
C/C++: __android_log_print(LogLevel, "Irrlicht", "%.*s\n", maxLogLen, &message[start]);
C/C++: ~~^~ ~~~~~~~~~
C/C++: 1 warning generated.
BUILD SUCCESSFUL in 25m 35s
73 actionable tasks: 67 executed, 6 up-to-date
util01@station40:~/ANDROID/LUANTI/luanti/android$ ls -l app/build/outputs/apk/debug
total 76988
-rw-r--r-- 1 util01 www-data 19880935 oct. 29 19:29 app-arm64-v8a-debug.apk
-rw-r--r-- 1 util01 www-data 17792645 oct. 29 19:29 app-armeabi-v7a-debug.apk
-rw-r--r-- 1 util01 www-data 20194901 oct. 29 19:29 app-x86_64-debug.apk
-rw-r--r-- 1 util01 www-data 20956443 oct. 29 19:29 app-x86-debug.apk
-rw-r--r-- 1 util01 www-data 1347 oct. 29 19:29 output-metadata.json
Installer la version : app-arm64-v8a-debug.apk
Sur le téléphone mobile.