LAMW Android Installation Tutorial lazarus / 43-Android ---------------------------------------------------------------------- gary · 2024-12-26 14:01 # LAMW Android Tutorial I am using Windows 11, 64-bit system. ## 1. Installation Section 1. I installed **laz4android3.4-FPC3.2.2.exe** on 2024-07-17.     Download link: [Laz4Android](https://sourceforge.net/projects/laz4a ndroid/files/?source=navba)     Reason: It has installed all the cross Android compilers: arm- android / aarch64-android / i386-android / x86_64-android / jvm- android.     If you want to install the cross compilers yourself, I haven’t learned about that. If anyone knows, feel free to share, or you can try using **Fpcupdeluxe** to install. 2. I installed **LAMW 0.8.6.4**.     Download the latest version of LAMW:     Link: [LAMW GitHub](https://github.com/jmpessoa/lazandroidmodulewiz ard/archive/master.zip)     After extracting, copy the files to **C:\laz4android3.4\components\**. Be careful not to misplace the directory; I think it won't matter too much since it's just a directory for storing components.     Then install the **LPK** files in this order:    - tfpandroidbridge_pack.lpk    - lazandroidwizardpack.lpk    - amw_ide_tools.lpk     If you can’t find the files, try searching in that directory. 3. I installed **JAVA JDK 21.0.2 (64-bit)**.     Download link: [Oracle JDK](https://www.oracle.com/cn/java/technologies/downloads/#java21)     I chose this: [JDK Download](https://download.oracle.com/java/21/la test/jdk-21_windows-x64_bin.exe)     Of course, you can install this JDK as well, but I haven't tried it:     [Adoptium](https://adoptium.net/]"]>Blockedrin/releases/) 4. I installed **Gradle 8.6**.     Download link: [Gradle Releases](https://github.com/gradle/gradle- distributions/releases/download/v8.11.1/gradle-8.11.1-all.zip)     I think you can download a higher version. 5. I installed **Apache Ant 1.10.14**.     Download link: [Apache Ant](https://ant.apache.org/bindownload.cgi)     I directly extracted it and placed it in the C drive (I believe you can place it in any directory). I think you can also download a higher version. 6. I installed **NDK r21e (Windows 64-bit version)**.     Download link: [NDK Unsupported Downloads](https://github.com/android/ndk/wiki/Unsupported-Downloads)     I do not recommend downloading a higher version as I am concerned about compatibility with the LAMW version. 7. I installed **SDK Commandline Tools** as **CommandlineTools- win-11076708_latest**.     Download link: [Android Command Line Tools](https://dl.google.com/android/repository/commandlinetools- win-11076708_latest.zip)     I created a target tree at **C:\android\sdkJ21\cmdline- tools\latest**.     I copied the extracted files to **C:\android\sdkJ21\cmdline- tools\latest\bin**.     Open a DOS command prompt and navigate to the bin directory, then execute:     ```bash    sdkmanager "build-tools;34.0.0" "platforms;android-34" "platform- tools"    ```    It’s particularly important to note that this directly impacts your directory settings in LAMW. If this step fails, it may lead to issues with the normal operation of LAMW (this is very important). 8. Install **Android Studio**.     The reason I installed it is to use its emulator. You can create a new emulator in it and name it **PFAPI35** (we'll use this name later).     Create a bat file and save the following code to execute (xxx is your computer username) to start the emulator, so you can test without connecting a phone:     ```bash    @echo off    echo 'Start AVD'    c:    cd C:\Users\xxx\AppData\Local\Android\Sdk\emulator    emulator -avd PFAPI35    ``` ## 2. Running Section 1. Project - New Project - LAMW [GUI] Android App. 2. NDK API: 22, Min. Device API: 23, Target API: 34. 3. Select Aarch64, as the emulator I installed seems to be Android 64-bit. I assume there might be errors if it’s different, which is very important. 4. Compile. 5. [LAMW] Build Android Apk and Run. ## 3. Congratulations! You can now explore the mysterious world of Android! --- The above document was updated on: December 26, 2024. Please correct me if I'm wrong, thank you very much! ---------------------------------------------------------------------- cdbc · 2024-12-26 15:07 Hi Cool mate, well done. Regards Benny ---------------------------------------------------------------------- Seenkao · 2024-12-27 07:05 QuoteSelect Aarch64, as the emulator I installed seems to be Android 64-bit.Если у вас компьютер на архитектуре x86_64, то и эмулятор надо выбирать этой же архитектуры. При этом надо помнить, что собирать проект надо именно по эту архитектуру или сразу под несколько, но чтоб данная архитектура поддерживалась в сборке. Для поддержки большинства устройств желательно делать сборку для 4-х архитектур: x86, x86_64, arm32 и arm64 (aarch64). -------------------------------------------- Google translate: If you have a computer with the x86_64 architecture, then you should choose the emulator of the same architecture. At the same time, you should remember that the project should be built for this architecture or for several at once, but so that this architecture is supported in the build. To support most devices, it is advisable to build for 4 architectures: x86, x86_64, arm32 and arm64 (aarch64). ---------------------------------------------------------------------- gary · 2024-12-31 03:42 Please tell me how to do this, I need details of the process, thanks! ---------------------------------------------------------------------- Seenkao · 2024-12-31 06:39 gary, я не могу в данном случае помочь, я занимаюсь немного другим направлением Android. И у меня настроено всё для сборки сразу 4-х  архитектур. Спросите у разработчика LAWM как это можно сделать. Google translate: gary, I can't help in this case, I'm working on a slightly different area of ​​Android. And I have everything set up to build 4 architectures at once. Ask the LAWM developer how to do this. ---------------------------------------------------------------------- trom · 2025-11-25 16:54 hello all, First, i would like to thanks everyone who works to make lazarus the great and best RAD of the world ! I had make all the TUTO was here but i have an error :    Verbose: Selected chip architecture: armeabi-v7a    Verbose: Taking libraries from folder: C:\Users\Utilisateur\Dev\LAMWProjects\AppLAMWProject2\libs\armeabi-v7a    Verbose: Found library: libcontrols.so    Note: Dupliquer l'unité "controls" dans "controls", orphaned ppu "C :\Users\Utilisateur\Dev\LAMWProjects\AppLAMWProject2\obj\controls\cont rols.o"    Note: Dupliquer l'unité "controls" dans "LCLBase 3.8", ppu="C:\lamw_manager\LAMW\LAMW4Windows\lazarus_trunk\lcl\units\arm- android\controls.ppu", source="C:\lamw_manager\LAMW\LAMW4Windows\lazar us_trunk\lcl\controls.pp"    Projet : Exécution de la commande précédente: Succès    before build...    Compilation du projet, OS : android, CPU : arm, Cible : C:\Users\Ut ilisateur\Dev\LAMWProjects\AppLAMWProject2\libs\armeabi- v7a\libcontrols.so : Succès    Projet : Exécution de la commande suivante: Succès    after build...    Building APK (Gradle)... : Succès    Starting APK (Gradle)... : FAILURE: Build failed with an exception., Erreurs : 1    Fatal: FAILURE: Build failed with an exception.    * What went wrong:    Execution failed for task ':installDebug'.    > com.android.builder.testing.api.DeviceException: No connected devices!     * 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.    Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.    For more on this, please refer to https://docs.gradle.org/8.5/userg uide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.    BUILD FAILED in 5s    34 actionable tasks: 1 executed, 33 up-to-date    Exception, Erreurs : 1    Fatal: [Exception] Failed: Cannot run APK! and when i start an emulator, i have this ( i have just put the line diferent from above) :    Fatal: FAILURE: Build failed with an exception.    * What went wrong:    Execution failed for task ':installDebug'.    > java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to install on any devices.     * Try: I have see this line :    Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. I have try with gradle 9.0.0 and gradle 9.2.1 but i have another error :   A problem occurred evaluating root project 'AppLAMWProject2'.   > Could not find method jcenter() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler. NOTE : my directory "\bin" is empty no file with .apk extension, i have find two APK in "\build\outputs\apk\release" and "\build\outputs\apk\debug" nut i cannot install them, my emulator and phone say : "invalid package" Thanks for all can help me ---------------------------------------------------------------------- dseligo · 2025-11-25 22:10 Quote from: trom on November 25, 2025, 05:54:17 pm   > com.android.builder.testing.api.DeviceException: No connected devices!  IMHO, you have to sort this out first. You can use Google's adb.exe tool to check if the phone is connected. Find it's location, open command prompt and use it like this (change path to wherever is your adb located): Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i C:\LazarusLAMW_2024-02-06\sdk\platform-tools\adb devices You are probably getting this: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i C:\>C:\LazarusLAMW_2024-02-06\sdk\platform-tools\adb devicesList of devices attached  C:\> Check your USB cable and if you turned on USB debugging on the phone. After connecting, you may also need to allow access from computer to the phone (you do this on the phone). Sometimes I got 'error: device unauthorized' - then I either put phone mode to 'charging only' and phone then asks me if I allow access or I turn USB debugging off and then again on. Anyway, you need to have this before you will succeed on installing apk on the phone: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i C:\>C:\LazarusLAMW_2024-02-06\sdk\platform-tools\adb devicesList of devices attachedRFCW381CNWW     device  C:\> ---------------------------------------------------------------------- trom · 2025-11-26 18:54 dseligo thanks for your help, I have  connected my Phone and ADB find himn i have no error in the error window of lazarus But: My phone said WRONG PACKAGE (incompatible), XIAOMI REDMI 11 And then i GO to the directory "\bin", i haven't file .apk ?? and when i go to  "\build\outputs\apk\release" and "\build\outputs\apk\debug" and take the two APK this package isn't compatible with any phone and  Tabs ? ---------------------------------------------------------------------- dseligo · 2025-11-26 22:40 Quote from: trom on November 26, 2025, 07:54:00 pmMy phone said WRONG PACKAGE (incompatible), XIAOMI REDMI 11 Try this: go to menu Project, Project Options and '[LAMW] Android Project Options', click tab 'Build' and there select 'Aarch64' chipset. Try to build and install again. ---------------------------------------------------------------------- trom · 2025-11-30 19:52 THANKS dseligo  , My first Goal was to use the EMULATOR come with the ANDROID SDK package, after your post i have found that this emulator is an  X86_64, i have put this configuration in the project option, and all is allright now !!! My Second goal was to use on my tablet TECLAST P20HD(AARCH64),  i activate the DEV mode and authorizing the usb debug, all is allright !!! My third goal is to instal on my phone, my phone is a xiaomi REDMI 9T (AARCH64), after put my phone un DEV mode and authorizing the usb debug, my phone wouldn't install the package, i have search and found an option on it, you must have a XIAOMI ACCOUNT and authorizing "INSTALL FROM USB" from the "DEV" menu, now all is allright !!. I will try soon on ZEBRA MC9300. ---------------------------------------------------------------------- dseligo · 2025-11-30 20:42 I'm glad it worked