[HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW) lazarus / 43-Android ---------------------------------------------------------------------- WayneSherman · 2018-04-02 20:36 MOVED to Wiki: 2023-Feb-06 https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe As of 2023-Nov-21, this error is still happening: https://forum.lazarus.freepascal.org/index.php/topic,21919.msg441567.h tml#msg441567 Changes 2023-Nov-21 ver 2.1  Add p7zip to package installation (fpcupdeluxe wants to use it)  Update FPCUPdeluxe version to 2.4.0a  Also tested Android SDK api level 33  Only tested on xubuntu-23.04-minimal-amd64 with aarch64 build 2023-May-22 ver 2.0   Added LAMW bug work-arounds for two cases:     1) Directly after creating a new project, save the project, close Lazarus, and re-open.     2) Directly after opening a demo project, save the project, close Lazarus, and re-open.       Tested on more distro versions     xubuntu-20.04.6-desktop-amd64     xubuntu-22.04.2-desktop-amd64 (minimal install)     xubuntu-23.04-minimal-amd64 (NOTE: I will not usually test on non- LTS versions)     manjaro-xfce-22.1.2-minimal-230518-linux61 (based on arch linux)       Manjaro does not have special issues with changing the LAMW project chipset - remove previous comment   Don't explicitly install freeglut3 (it gets pulled in if needed by freeglut3-dev)   Remove subversion from install packages (fpc and lazarus both use git now)   Remove apache-ant from pacman (arch linux) install (fpcupdeluxe installs a private copy)   Testing with updated software components:     fpcupdeluxe 2.2.0r     OpenJDK ver 11.0.19     Lazarus stable v2.2.6 2023-Feb-06 ver 1.9  Add support for Arch Linux based distros  Test on Manjaro 22.0  Add known issues based Manjaro testing 2023-Feb-06 ver 1.8  Use $BASE for installation directory (defaults to $HOME)  Android Command-Line Tools for Linux build 9477386  OpenJDK 11.0.17  Gradle 6.8.3 (installed automatically by FPCUPdeluxe)  FPCUPdeluxe ver 2.2.0n  Lazarus stable v2.2.4 ---------------------------------------------------------------------- WayneSherman · 2018-04-02 20:37 RESERVED FOR FUTURE USE ---------------------------------------------------------------------- WayneSherman · 2018-04-02 20:37 See first post (above) for newest install procedure ^^ [OLDER / ARCHIVED INSTRUCTIONS BELOW] 2019-May-20 ver 1.3 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 # Setup Android Development Environment on Linux (FPCUPdeluxe / LAMW)# Tested on Xubuntu 16.04 64-bit and Xubuntu 18.04 64-bit# Target 32-bit ARM on Android# Target 64-bit aarch64 on Android# 2019-May-20 ver 1.3 # Install libraries and toolssudo apt-get install -y libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev libxtst-dev libatk1.0-dev libghc-x11-dev freeglut3 freeglut3-devsudo apt-get install -y git subversion make build-essential gdb zip unzip unrar wgetsudo apt-get install -y openjdk-8-jdk android-tools-adb ant #Note:  Next line is not needed on Ubuntu 16.04sudo update-java- alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64 mkdir -p "$HOME/android/sdk" # download and extract Android SDK Command Line Tools for Linux# from https://developer.android.com/studio/#downloadscd "$HOME/android/sdk"wget "https://dl.google.com/android/repository/sdk- tools-linux-4333796.zip"unzip "sdk-tools-linux-4333796.zip"rm "sdk- tools-linux-4333796.zip" #Install SDK packages and NDK (as of 2019-May-20 this pulls in NDK r19c)cd "$HOME/android/sdk/tools/bin"./sdkmanager "platforms;android-26" "build-tools;26.0.3" "tools" "ndk-bundle" "extras;android;m2repository" # make symbolic link to NDK toolchainln -sf "$HOME/android/sdk/ndk-bundle/toolchains/arm-linux- androideabi-4.9/prebuilt/linux-x86_64/bin" "$HOME/android/ndk- toolchain" # work around bug, NDK 18 removed MIPS toolchains, but gradle plugin 3.0.1 won't run unless they are presentln -sf "$HOME/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9" "$HOME/android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9"ln -sf "$HOME/android/sdk/ndk-bundle/toolchains/arm-linux- androideabi-4.9" "$HOME/android/sdk/ndk-bundle/toolchains/mipsel- linux-android-4.9" # download and extract Gradle 4.10.3# from https://gradle.org/releases/cd "$HOME/android"wget "https://services.gradle.org/distributions/gradle-4.10.3-bin.zip"unzip "gradle-4.10.3-bin.zip"rm "gradle-4.10.3-bin.zip" # Use a text editor to open $HOME/.profile and add this text below:# example: mousepad $HOME/.profileexport ANDROID_SDK_ROOT="${HOME}/android/sdk"export GRADLE_HOME="${HOME}/android/gradle-4.10.3"export PATH="${PATH}:${HOME}/android/ndk-toolchain"export PATH="${PATH}:${GRADLE_HOME}/bin" # Reboot (or logout of session and login) # Download FPCUPdeluxe from https://github.com/newpascal/fpcupdeluxe/releases/latest# (tested with version 1.6.2v)mkdir "$HOME/fpcupdeluxe_app"cd "$HOME/fpcupdeluxe_app"wget "https://github.com/newpascal/fpcupdeluxe/ releases/download/1.6.2v/fpcupdeluxe-x86_64-linux"chmod +x fpcupdeluxe-x86_64-linux./fpcupdeluxe-x86_64-linux# Using FPCUPdeluxe install FPC/Lazarus, crosscompiler, and packages/modules:# 1) On "Basic" tab, select FPC version "fixes3.2" & Lazarus version "fixes2.0" and click "Install/update FPC+Laz" button (if this fails, please see comments in next post)# 2) On "Cross" tab, select CPU arm & OS android, "Install compiler" (select "yes" to missing tools message box)# 3) On "Cross" tab, select CPU aarch64 & OS android, "Install compiler" (Ignore trunk warning, select "yes" to missing tools message box)# 4) On Modules tab, select LAMW, Install module# 5) (Optional but recommended) In module list: Select OPM, Install module (online package manager) # Run Lazarus using the shortcut created by FPCUPdeluxe # NOTE: DO NOT forget to replace references to [user] with your user name in 3 paths below# Select Tools menu > [Lamw] Android Module Wizard > Paths Settings: [Jdk, Sdk, Ndk, ...]:# Path to Java JDK: /usr/lib/jvm/java-8-openjdk-amd64# Path to Ant bin: /usr/bin# Path to Gradle: /home/[user]/android/gradle-4.10.3# Path to Android NDK: /home/[user]/android/sdk/ndk-bundle# NDK Version: >11# Your Desktop System: linux-x86_64# Path to Android SDK: /home/[user]/android/sdk # For new LAMW projects, use Gradle for APK Builder and#  for 32-bit:  ARMv7a + VFPv3 for Architecture/Instructions#  for 64-bit:  Aarch64 for Architecture/Instructions  Manjaro Linux (based on Arch Linux). (Note: not tested since 2018-Apr-19) Manjaro requires these changes: 1) Instead of apt-get, use pacman with these packages: # Install libraries and tools sudo pacman -S --needed libx11 gtk2 gdk-pixbuf2 cairo pango libxtst atk freeglut sudo pacman -S --needed git subversion make gdb zip unzip unrar wget sudo pacman -S --needed android-tools apache-ant jdk8-openjdk 2) #Install SDK packages and NDK using sdkmanager In my test the NDK was not installing and sdkmanager gave an error "No space left on device".  By default /tmp is a tmpfs limited to half the size of your RAM, if your RAM size is small, you may have to temporarily unmount /tmp from tmpfs before installing sdk/ndk packages: sudo umount -l /tmp (remember to manually delete files in /tmp before rebooting) 3) The PATH environment is setup in a different file: # Use a text editor to open $HOME/.bash_profile and add this text below: # example: kate $HOME/.bash_profile export PATH="${PATH}:${HOME}/android/ndk-toolchain" export PATH="${PATH}:${HOME}/android/gradle-4.10.3/bin" export ANDROID_SDK_ROOT="$HOME/android/sdk" 4) When setting LAMW paths, the JDK has a different path on Manjaro # Select Tools menu > [Lamw] Android Module Wizard > Paths Settings: [Jdk, Sdk, Ndk, ...]: ... # Path to Java JDK: /usr/lib/jvm/java-8-openjdk Comments for 2019-May-20 ver 1.3 > 24. #Install SDK packages and NDK When installing the NDK using sdkmanager, you cannot select an older version, it installs the latest version. > 26.  ./sdkmanager "platforms;android-26" "build-tools;26.0.3" "tools" "ndk-bundle" "extras;android;m2repository" I chose to install Android platform 26.  A given Android platform also supports previous API Levels.  (usage stats for Andriod API Levels).  As of gradle plugin 3.0.0, the appropriate build-tools package is automatically downloaded if needed during the gradle build, but I included it here to work around a LAMW issue.  To view a list of available packages use ./sdkmanager --list > 35. # download and extract Gradle 4.10.3 note to self:  LAMW uses the Gradle directory name internally to determine the Gradle version > 42. # Use a text editor to open $HOME/.profile and add this text below: .profile seems to be the proper file for this on Ubuntu(s).  .bashrc gets re-run for every subshell which creates multiple path entries. (NOTE:  .profile is not called if ~/.bash_profile or ~./bash_login exist) > 51. # Download FPCUPdeluxe If the latest version of FPCUPdeluxe doesn't build FPC/Lazarus successfully (particularly if you're using stable/stable), try the same version that I tested. > 59. # 1) On "Basic" tab, select FPC version "fixes3.2" & Lazarus version "fixes2.0" Originally I used trunk for both FPC and Lazarus in order to work with the most current code.  Depending the state of Lazarus/FPC in regards to bugs and ARM/Android issues, you may have to use different versions.  As of 2019-May-20, FPC trunk is causing a "buffer error" when starting Lazarus.  I switched to the latest "fixes" versions of both FPC and Lazarus which are newer than "stable", but more stable than "trunk".  There are some android related bugs fixed in FPC development version 3.1.1 and later (see here). > 62. # 4) On Modules tab, select LAMW, Install module Installing LAMW from FPCUPdeluxe pulls from GIT.  Do this anytime you want to update LAMW to the latest code. 2019-May-20 Building a simple test project: Project | New Project... LAMW [GUI] Android Module Set project folder, (ex. /home/user/test) Automated Build = Gradle For 32-bit:  Architecture/Instructions = ARMv7a + VFPv3 For 64-bit:  Architecture/Instructions = Aarch64 Use defaults for other settings Click OK Click Save if prompted to save files Drop a label, edit box, button on the form from Android Bridge Component Tab (jTextView, jEditText, jButton) Run | Build From a command line run "gradle_local_build.sh" from the project folder if successful, your compiled APK files are in ./build/outputs/apk Installing and Using the Android Emulator: (the method described here uses the command line, another method is to install Android Studio) #Install the emulator and a system image cd ~/android/sdk/tools/bin ./sdkmanager "emulator" "system-images;android-24;default;armeabi-v7a" (to get a list of system images use ./sdkmanager --list) #Create some android virtual devices (AVD) #generic test device ./avdmanager create avd -n "my_test_device" -k "system- images;android-24;default;armeabi-v7a" #Galaxy Nexus device ./avdmanager create avd -n "Galaxy_Nexus" -d "Galaxy Nexus" -k "system-images;android-24;default;armeabi-v7a" (to get a list of devices use ./avdmanager list devices) (after creation, AVD files are stored in:  ~/.android/avd/) #Run the emulator cd ~/android/sdk/emulator ./emulator -no-snapshot-load -avd "my_test_device" -use-system-libs -gpu swiftshader_indirect (to get a list of available AVDs, use ./emulator -list-avds) (note: I had to use -gpu swiftshader_indirect to enable software rendering since I am running inside a virtual machine, more info here.  Inside my VM the emulator was running slow, so if you get any android "Process isn't responding" messages, click "Wait".  The emulator was unstable when loading from a snapshot, the workaround is to use -no-snapshot-load) #Run your project in the emulator: From a command line run "gradle_local_run.sh", or from the Lazarus IDE menu select Run | [LAMW] Build Android Apk and Run How to build demos (still working on it. but have had some success by doing steps below as a 32-bit example): Open a demo project and change In Project | Project Options | Compiler Options | Paths Libraries: /home/[user]/android/sdk/ndk-bundle/platforms/android-27/arch- arm/usr/lib/;/home/[user]/android/sdk/ndk-bundle/toolchains/arm-linux- androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux- androideabi/4.9.x/ (remove [user] and replace with your user name) Target File name: ../libs/armeabi-v7a/libcontrols In Project | Project Options | Compiler Options | Custom Options -Xd -CfVFPv3 -CpARMV7A -XParm-linux-androideabi- -FD/home/[user]/android/sdk/ndk-bundle/toolchains/arm-linux- androideabi-4.9/prebuilt/linux-x86_64/bin (remove [user] and replace with your user name) Run gradle_local_build.sh from a command line. ---------------------------------------------------------------------- jmpessoa · 2018-04-03 00:09 Hello, WayneSherman! First: Thank you!  [I added your tutorial to git LAMW!] About  "How to build demos" We need some test,  Can you help?  [Please,  update your LAMW...  there is some bug fixed!] 1)  Open a demo and save it ...  what config changes you got [Libraries and Custom...]? 2)  Open a demo and and try "Run--> build" what config changes you got [Libraries and Custom...]? The code is here: LAMW  "android_wizard\smartsesigner.pas" Quote  if IsDemoProject() then   begin     TryChangeDemoProjecPaths();   end ---------------------------------------------------------------------- WayneSherman · 2018-04-03 03:54 Quote from: jmpessoa on April 03, 2018, 02:09:41 amAbout  "How to build demos" We need some test,  Can you help?  [Please,  update your LAMW...  there is some bug fixed!] Yes, I can help.  Let's move to a new thread please. See "[LAMW] Getting Demos to Build" here:  https://forum.lazarus.freepascal.org/index.php/topic,40756.0.html ---------------------------------------------------------------------- WayneSherman · 2018-04-17 03:08 See updates to Post #3 above Building a simple test project: (fixed an error, and simplified due to improvements in LAMW) Installing and Using the Android Emulator: (the method described here uses the command line, another method is to install Android Studio) How to build demos (simplified due to some improvements in LAMW, but there are some more changes needed in LAMW to automatically generate correct build settings) ---------------------------------------------------------------------- HobbyDev · 2018-04-17 19:59 Something I am doing wrong! Since I am on Arch Linux I had to find out where to get the right packages... But now - after running FPCUPdeluxe - i got several times the message: QuoteFpcupdeluxe has [created] a shortcut link in your home-directory to start Lazarus. Shortcut-link: Lazarus_fpcupdeluxe Lazarus MUST be started with this link !! Fpcupdeluxe has also (tried to) create a desktop shortcut with the same name. I do not have the "Android Module Wizard" in the tools menu. What can I check to get it done? Thanks in advanced! ---------------------------------------------------------------------- jmpessoa · 2018-04-17 20:11 > 50. # 3) [FPCUPdeluxe] In module list:  Select LAMW, Install module ---------------------------------------------------------------------- WayneSherman · 2018-04-17 21:57 Quote from: jmpessoa on April 17, 2018, 10:11:15 pm> 50. # 3) >[FPCUPdeluxe] In module list:  Select LAMW, Install module Two other things to check: 1) Check if FPCUpdeluxe downloaded the LAMW files.  On my computer the LAMW files are found in ~/fpcupdeluxe/ccr/lamw 2) Read the FPCUpdeluxe log messages to see if there are any errors recompiling Lazarus ---------------------------------------------------------------------- HobbyDev · 2018-04-18 06:10 Yes the LAMW ist installed. Checking the directory /home/user/fpcupdeluxe/ccr/lamw I found 11948 objects  with a total size of 61,5 MB. But where to find the FPCUpDeluxe Log- files? If I am running the script I get the following messages in the terminal: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ ./Lazarus_fpcupdeluxeusing config file /home/user/fpcupdeluxe/lazarus/lazarus.cfgSetPrimaryConfigPath NewValue="/home/user/fpcupdeluxe/config_lazarus" -> "/home/user/fpcupdeluxe/config_lazarus"SetPrimaryConfigPath NewValue="/home/user/fpcupdeluxe/config_lazarus" -> "/home/user/fpcupdeluxe/config_lazarus"Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/user/fpcupdeluxe/config_lazarus"Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"Looking for code tools config file:  "/home/user/fpcupdeluxe/config_lazarus/codetoolsoptions.xml"NOTE: codetools config file not found - using defaultsHint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux- gtk2 FPC=True LCL=FalseNOTE: help options config file not found - using defaultsTComponentTreeView.SetSelection: Updating component node values. I did the LAMW installation again. This is a part of the log from FPCUpDeluxe: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Name=lamwDescription="A wizard to create JNI Android loadable module (.so) in Lazarus/Free Pascal using [datamodule like] Form Designer and Components!"Installdir=$(basedir)/ccr/$(name)Enabled=0GitURL=https://g ithub.com/jmpessoa/lazandroidmodulewizardArchiveURL=https://github.com /jmpessoa/lazandroidmodulewizard/archive/master.zipAddPackage1=$(Insta lldir)/lamw-master/android_bridges/tfpandroidbridge_pack.lpkAddPackage 2=$(Installdir)/lamw-master/android_wizard/lazandroidwizardpack.lpkAdd Package3=$(Installdir)/lamw- master/ide_tools/amw_ide_tools.lpkUnInstall=rm -Rf $(Installdir) [color=red]fpcupdeluxe: WARNING: UniversalInstaller (AddPackages): Package tfpandroidbridge_pack.lpk not found ... skipping.[/color]fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: tfpandroidbridge_pack): Removing package from config-filesfpcupdeluxe: info: UniversalInstaller (UnInstallPackage: tfpandroidbridge_pack): Going to uninstall packagefpcupdeluxe: info: UniversalInstaller (UnInstallPackage: tfpandroidbridge_pack): Checking lpl file for tfpandroidbridge_pack.lpkfpcupdeluxe: WARNING: UniversalInstaller (UnInstallPackage: tfpandroidbridge_pack): Package lazandroidwizardpack.lpk not found ... skipping.fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: lazandroidwizardpack): Removing package from config-filesfpcupdeluxe: info: UniversalInstaller (UnInstallPackage: lazandroidwizardpack): Going to uninstall packagefpcupdeluxe: info: UniversalInstaller (UnInstallPackage: lazandroidwizardpack): Checking lpl file for lazandroidwizardpack.lpk[color=red]fpcupdeluxe: WARNING: UniversalInstaller (UnInstallPackage: lazandroidwizardpack): Package amw_ide_tools.lpk not found ... skipping.[/color]fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: amw_ide_tools): Removing package from config-filesfpcupdeluxe: info: UniversalInstaller (UnInstallPackage: amw_ide_tools): Going to uninstall packagefpcupdeluxe: info: UniversalInstaller (UnInstallPackage: amw_ide_tools): Checking lpl file for amw_ide_tools.lpk  SUCCESS: Fpcupdeluxe ended without errors. Fpcupdeluxe has [created] a shortcut link in your home-directory to start Lazarus.Shortcut-link: Lazarus_fpcupdeluxeLazarus MUST be started with this link !!Fpcupdeluxe has also (tried to) create a desktop shortcut with the same name. Hope that helps... ---------------------------------------------------------------------- DonAlfredo · 2018-04-18 06:16 @HobbyDev Could you give more details about the errors you encounter ? Your last post does not give much info. * Does Lazarus start ? * Do you have LAMW in the tools of Lazarus ? (I am the maintainer of fpcupdeluxe) ---------------------------------------------------------------------- HobbyDev · 2018-04-18 06:22 I just edited (extented) my last post. Please check this  Yes - Lazarus is starting, and no I don't see anything regarding LAMW in Lazarus ---------------------------------------------------------------------- DonAlfredo · 2018-04-18 06:43 Yes, this helps ! It seems that fpcupdeluxe was not able to find the LAMW files (reason yet unknown to me), so the most easy thing is to install LAMW manually. Start Lazarus. Click "Package" and Click "Open Package File (.lpk)" Navigate towards (in ccr): android_bridges/tfpandroidbridge_pack.lpk Click "Use"and click "Ïnstall" Do the above also for: android_wizard/lazandroidwizardpack.lpk ide_tools/amw_ide_tools.lpk This should give you LAMW tools in Lazarus. Good luck ! ---------------------------------------------------------------------- WayneSherman · 2018-04-18 07:56 Quote from: HobbyDev on April 18, 2018, 08:22:29 amI just edited (extented) my last post. Please check this  Yes - Lazarus is starting, and no I don't see anything regarding LAMW in Lazarus In FPCUPdeluxe, I re-tested the FPC/Lazarus install, and at the moment Lazarus trunk does not compile (also stable/stable causes a compiler runtime error when compiling Lazarus).  I did get FPC trunk and Lazarus stable to work.  (tested with FPCUPdeluxe v1.6.0p) Another possible clue regarding your installation of the LAMW module, my package paths are different from yours: (excerpt from FPCUPdeluxe log)   Name=lamw   Description="A wizard to create JNI Android loadable module (.so) in Lazarus/Free Pascal using [datamodule like] Form Designer and Components!"   Installdir=$(basedir)/ccr/$(name)   Enabled=0   GitURL=https://github.com/jmpessoa/lazandroidmodulewizard   ArchiveURL=https://github.com/jmpessoa/lazandroidmodulewizard/archiv e/master.zip   AddPackage1=$(Installdir)/android_bridges/tfpandroidbridge_pack.lpk   AddPackage2=$(Installdir)/android_wizard/lazandroidwizardpack.lpk   AddPackage3=$(Installdir)/ide_tools/amw_ide_tools.lpk   UnInstall=rm -Rf $(Installdir) Your paths have an additional directory: AddPackage1=$(Installdir)/lamw- master/android_bridges/tfpandroidbridge_pack.lpk AddPackage2=$(Installdir)/lamw- master/android_wizard/lazandroidwizardpack.lpk AddPackage3=$(Installdir)/lamw-master/ide_tools/amw_ide_tools.lpk ---------------------------------------------------------------------- DonAlfredo · 2018-04-18 08:14 @WayneSherman I presume that HobbyDev does not have GIT installed. If not GIT available, fpcupdeluxe will download the LAMW-sources as a zip. This will add the extra path, but this should also be handled automagically by fpcupdeluxe, but not in the case of HobbyDev. And that is a strange error ! ---------------------------------------------------------------------- HobbyDev · 2018-04-18 19:52 Hmm - didn't work - unfotunatly. I startet withe this first package, everything worked fine "linking lazarus" was the last message I saw, then Lazarus restartet but all I got is the into-picture, nothing else. In Terminal I get a lot of information, here are just the last lines... QuoteException at 0000000000000000: EAccessViolation: Access violation. TApplication.HandleException Access violation   Stack trace:   $00007F0ECCADF27F Exception at 00007F0ECCADF27F: EAccessViolation: Access violation. LAZARUS END - cleaning up ... [FORMS.PP] ExceptionOccurred   Sender=EAccessViolation   Exception=Access violation   Stack trace:   $00007F0ECCACACD8 TApplication.HandleException Access violation   Stack trace:   $00007F0ECCACACD8 Exception at 00007F0ECCACACD8: EAccessViolation: Access violation. retrying the packeage installation doesn't help. Good night for today! ---------------------------------------------------------------------- WayneSherman · 2018-04-19 04:28 Updated installation procedure to 2018-Apr-18 ver 0.9: (see first post) 1) Add gdb and wget to package install 2) More simplification, only creating one symlink instead of four (also required adjustment to the LAMW NDK path) 3) Regarding which versions of FPC and Lazarus to install using FPCUPdeluxe, see "> 45" comments in post #2. 4) Tested on Manjaro Linux and added changes required for that distro. ---------------------------------------------------------------------- HobbyDev · 2018-04-21 20:40 Well done! Pretty good job you have done! Im almost through! The last point I have is, when creating the test project I get the failure message that I  have to install sdk 26.x.y. But if I try Code: [Select]$ ./sdkmanager "26.0.2"I get Code: [Select]Warning: Failed to find package 26.0.2I checked the directory Code: [Select]/home/user/Android/android-sdk/platforms/android-26/ and there is some stuff in there. I also checked the path settings inside Lazarus again and they the sdk- path points to /home/user/Android/android-sdk What else can I do? Many Thanks so far! ---------------------------------------------------------------------- jmpessoa · 2018-04-21 21:08 Try: ./sdkmanager "platforms;android-26" "build-tools;26.0.3" QuoteI checked the directory ... You need check the folder: /home/user/Android/android-sdk/build-tools/ and see if there is some "26.x.x"  there.... ---------------------------------------------------------------------- HobbyDev · 2018-04-21 21:37 That did the job! Thank you very much! I was trying to place a lable as written in Post #2 or a button but got the error message Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Invalid Parent - A TAndroidModule1 cannot hold TControls.You can only put non visual components on it. But this is an other thing - probably here starts the new world for me, starting reading, learning... ---------------------------------------------------------------------- jmpessoa · 2018-04-21 22:20 Yes, You cant put a LCL component in AndroidModule/jForm ... Use only the components from "Android Bridges XXX"  palettes ---------------------------------------------------------------------- HobbyDev · 2018-04-22 09:14 Many Thanks again! Got it! ---------------------------------------------------------------------- WayneSherman · 2018-09-30 01:02 Created a new wiki page for LAMW Linux Installation Updated installation procedure to 2018-Sep-29 ver 1.1: (see first post) 1) Work arounds were needed to deal with recent NDK / Gradle changes. 2) Updated command line SDK tools to "sdk-tools-linux-4333796.zip". 3) Using newer platform and build tools (ver 26 instead of ver 25) 4) Added MIPS toolchain links to work around NDK and gradle plugin inconsistency. 5) Using new Gradle:  gradle-4.10.2-bin.zip (previous was 4.1) 6) Add new environment variable: export ANDROID_SDK_ROOT="$HOME/android/sdk" 7) Tested with newer FPCUPdeluxe version (ver 1.6.1m) A shoutout to Handoko for his recent hard work to create a new detailed Linux installation procedure.  Thanks for sharing. He makes some different choices than I do, but nothing wrong with that.  Its good to have choices. :-) Check it out here:   LAMW 0.8 on Ubuntu 18.04 Installation Guide by Handoko ---------------------------------------------------------------------- WayneSherman · 2018-09-30 04:42 Updated installation procedure to 2018-Sep-29 ver 1.2: (see first post) 1) Tested and working with Xubuntu 18.04. 2) Add "update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64" to set default java to openjdk-8-jdk 3) Added commands to download and run fpcupdeluxe See also:  Wiki page for LAMW Linux Installation ---------------------------------------------------------------------- jmpessoa · 2018-09-30 17:49 Commited to LAMW git repository!!! Thank you! ---------------------------------------------------------------------- WayneSherman · 2019-05-20 17:53 Updated installation procedure to 2019-May-20 ver 1.3: (see first post) Tested and working with Xubuntu 16.04 and 18.04. 1) sdkmanager is now pulling in NDK r19c (was r18) 2) Update sdk build-tools to 26.0.3 (was 26.0.2) 3) Update Gradle to 4.10.3 (was 4.10.2) 4) Update FPCUPdeluxe to version 1.6.2v (was 1.6.1m) 5) FPC branch is now "fixes3.2" (was trunk) 6) Lazarus branch is now "fixes2.0" (was trunk) (the "fixes" branches are more stable than trunk) 7) Add support for 64-bit android (aarch64)  :-) The 64-bit Android (aarch64) support was a team effort. Thank you to:   yuriy_sydorov (aarch64 support in fpc compiler)   DonAlfredo (aarch64 support in FPCUPdeluxe)   jmpessoa (aarch64 support in LAMW) See also:  Wiki page for LAMW Linux Installation ---------------------------------------------------------------------- JackDca · 2020-01-23 16:01 Wayne Sherman, and other contributors - !!THANK YOU!! for this guide. Without it I would never have been able to get Lazarus Android cross- compiles working. Here are some notes on installing and testing the Lazarus-Android build system which might help others in the process. This was done on 2020-01-21. My system runs Debian. Lazarus is installed on it and configured to target Debian. Since the Lazarus-Android IDE had been tested on Xubuntu 18.04 64 bit I hosted it on a VirtualBox Ubuntu 18.04 virtual machine. (Should have used Xubuntu, not Ubuntu. Next time!) This was a good thing because I had to start over more than once! Details: - Ubuntu 18.04 LTS. - System disk: 23 GB (default 10 GB is not enough). - System RAM: 3072 MB (2048 MB is not enough). - Under "Updates and other software" select "Minimal installation", deselect "Download updates while installing Ubuntu". - When Ubuntu install is complete, run Settings application, Power- Power Saving-Blank screen-Never. Re the last item: blanking of the virtual machine screen and/or blanking of the host machine screen appeared to cause crashes. When leaving the machines running unattended, if virtual machine had the mouse and keyboard captured that appeared to prevent blanking of the host machine screen. - When running ./fpcupdeluxe-x86_64-linux, Basic tab, used FPC "fixes3.2" and Lazurus  "2.0.2". (The recomended "fixes3.2" "fixes2.0" resulted in failure.) - When running ./fpcupdeluxe-x86_64-linux, Build Modules-OPM-Install module fails. Just ignored that because it is optional. When building the APKs the correct command line is ./gradle-local-build.sh NOT ./gradle_local_build.sh I tried installing both the "debug" and "release-unsigned" APKs on my Asus TF700T running Cyanogenmod Android 4.4.4. The "debug" version installed and ran, the "release-unsigned" did not install. - When the app was run, the widgets were not correctly placed on the screen. Next challenge - get the widget placement working! ---------------------------------------------------------------------- JackDca · 2020-01-24 17:23 When I follow the instructions to build a test APK (with jtextview, jeditext and jbutton controls) the project seems to build OK. But, when I install on the target Android device, all three controls are in the upper left-hand corner of the screen. Investigating this, in Lazarus on the build machine, when I mouse over the controls, the tooltip for each control shows "Position 0,0" which is consistent with what I see on the target device. Yet if I look at the .lfm file the positions look reasonable e.g. for the jTextView control Left = 72 Top = 49 Width = 64 Height = 19 Any suggestions? ---------------------------------------------------------------------- Handoko · 2020-01-24 17:52 Quote from: JackDca on January 24, 2020, 06:23:29 pmLeft = 72 Top = 49 Width = 64 Height = 19 Don't set those values directly. Instead you should configure these: - LayoutParamHeight - LayoutParamWidth - PosRelativeToAnchor - PosRelativeToParent Read more: https://forum.lazarus.freepascal.org/index.php/topic,43767.msg306821.h tml#msg306821 ---------------------------------------------------------------------- JackDca · 2020-01-24 19:11 Thanks - I will look at the link you sent. ---------------------------------------------------------------------- JackDca · 2020-01-27 17:23 Hello Handoko, OK, I studied the link that you pointed me at. I think there's some information missing. You say to  configure LayoutParamHeight. How?  Is there a dialog to do this? Do I edit a text file? Is there an example somewhere? Would really appreciate your guidance. I have searched through the wikis and I am not finding anything helpful. Thanks ---------------------------------------------------------------------- jmpessoa · 2020-01-27 17:51 from: https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/LAMW_Ge tting_Started.txt Quote[FAQ 2]: [Thanks to Ahmad Bohloolbandi (a.k.a. @developing) ] #Question: How do we can design a layout that shown same in real device? [Answer]: You should use the component properties:       "Anchor",       "PosRelativeToParent",       "PosRelativeToAnchor",       "LayoutParamHeight",       "LayoutParamWhidth"           Example: 1-Put a "jTextView" component on your AndroidModule form:    Set "PosRelativeToParent"       "rpCenterHorizontal" [True]       "rpTop" [True] 2-Put a "jButton" component on AndroidModule form:    Set "Anchor" to "jTextView" (Because you should set position relative with "jTextView")    set "PosRelativeToAnchor"       "raBelow" [True] 3-Put a "jEditText" component on form:    Set "Anchor" to "jButton".    Set "PosRelativeToAnchor"       "raBelow" [True] NOTE:    Anchor setting is most important section of this design,    because your component position depends on this property.    And for change width and/or height of each components you should    change/configure "LayoutParamWhidth" and/or "LayoutParamHeight". ---------------------------------------------------------------------- Handoko · 2020-01-27 17:56 @JackDca My computer has some some minor issues, I can't run my LAMW. I'm going to explain using what I can remember. Try to click the component you want to set its layout, for example click your "JButton1". Then in the Object Inspector, you should able to find these properties: - Anchor - LayoutParamHeight - LayoutParamWidth - PosRelativeToAnchor - PosRelativeToParent LayoutParamHeight and LayoutParamWidth are used to configure the size of the component. PosRelativeToAnchor and PosRelativeToParent are needed to set the position of the component. For example you want the component to be set to the center its parent, you set PosRelativeToParent := rpCenterHorizontal; And to set the y position of the component, you need the set the Anchor. Also, you may need to set the margins. Because Android apps need to 'look' good on any screen resolution and allow users to freely change its orientation (landscape/portrait), you do not set the component's position values directly. Instead you have to set how the component is related to the others. ---------------------------------------------------------------------- JackDca · 2020-01-27 18:36 @Handoko and @jmpessoa, The fact that Object Inspector is used to set the parameters was the missing piece of information. Probably obvious to you, but not to this newbie! Thanks again. ---------------------------------------------------------------------- Handoko · 2020-01-27 18:43 You're right. I forgot to tell you where to find them. ---------------------------------------------------------------------- JackDca · 2020-01-29 17:09 OK, sorry to be a pest, but ... I am now getting the following error termination when I do a Lazarus Run-Build of the "simple test project" as per Reply #2: Messages Verbose: Selected chip architecture: armeabi-v7a Verbose: Taking libraries from folder: /home/jack/Projects/TestAndroid2/libs/armeabi-v7a Compile Project, OS: android, CPU: arm, Target: /home/jack/Projects/TestAndroid2/libs/armeabi-v7a/libcontrols.so: Exit code 1, Errors: 1 Fatal: Cannot find system used by controls. Make sure all ppu files of a package are in its output directory. ppu in wrong directory=/home/jack/fpcupdeluxe/fpc/units/arm- android/rtl/system.ppu.. This is very strange in that I have done successful builds before. Thinking that I had perhaps corrupted something in the Lazarus setup, I restored a copy of the virtual machine that I had saved immediately after installing Lazarus (including "Path Settings"), and before doing my first successful Lazarus build. The problem is still there. I think I am doing everything exactly the same way that I did it previously, but clearly I am not. The only idea I have had is that the Build process is pulling something from the Internet that has changed in the last few days. Any suggestions? Thank you for your help. ---------------------------------------------------------------------- jmpessoa · 2020-01-29 17:29 You can try a "New Project"   .... ---------------------------------------------------------------------- JackDca · 2020-01-31 15:35 OK - problem solved - after some searching on the Internet and especially this post (thanks again to @jmpessoa and other posters): https://forum.lazarus.freepascal.org/index.php?topic=41918.0 The "Fatal: Cannot find system used by controls." message appears to be caused by a mismatch between the chipset specified when setting up Lazarus with fpcupdeluxer and the chipset specified when doing Run- Build with Lazarus. In my first setup these appear to have been configured to match, but later the chipset for the build had changed, perhaps unwittingly by me, or perhaps because it reverted to a default. in any case, it was fixed in Lazarus by Project-Project Optinos-LAMW Android Project Options-Build-Chipset and selecting ArmV7APv3 (which apparently had been changed to ArmV7A+Soft). While there you might want to turn off most of the permissions to be requested by the application. The default is to request all permissions, which seems a bit dangerous. This is at Project-Project Optinos-LAMW Android Project Options-Android Manifest- Permissions. ---------------------------------------------------------------------- circular · 2020-05-17 17:42 Those are great instructions, this is quite complex indeed. I installed everything, made the test program, but when I run the emulator, the screen remains black, and at some point my computer freezes. Even the mouse cursor cannot move anymore. Then I have only the option of pressing the power buttons for 4 seconds to turn off the computer. ---------------------------------------------------------------------- Seenkao · 2020-05-17 21:49 do not use emulator Эмулятор не работает с JNI. (does not work with jni) ---------------------------------------------------------------------- circular · 2020-05-18 14:04 Ok. Hmm well then I would need to buy an Android phone. ---------------------------------------------------------------------- lainz · 2020-05-22 01:58 Quote from: circular on May 18, 2020, 04:04:01 pmOk. Hmm well then I would need to buy an Android phone. I recommend you a Samsung phone, even the cheap ones are good. I have one with only 16gb of disk space (Samsung j5 prime, 2016 model) and I can install everything, except big games, but everything else works. With one of 32gb of space will be enough for everything else. This is a new model, cheap but good (i'm not sponsoring, just sharing my opinion) https://www.amazon.es/s?k=Samsung+Galaxy+A10&rh=p_n_availability%3A- 1&ascsubtag=64168&linkCode=osi&tag=choyfichas-21 My opinion is to start with it at least, but if you can buy a better one, better of course =) ---------------------------------------------------------------------- circular · 2020-05-22 09:37 Cool, thanks for the tip! ---------------------------------------------------------------------- Thyphoon · 2020-05-31 12:48 This is a bit old, but you can use memu or any other emulator, just need to connect it via adb: https://forum.lazarus.freepascal.org/index.php/topic,49286.msg356821.h tml#msg356821 ---------------------------------------------------------------------- circular · 2020-06-06 09:33 Memu seems to be for Windows only. ---------------------------------------------------------------------- MarkMLl · 2020-06-06 11:08 Quote from: lainz on May 22, 2020, 03:58:21 amI recommend you a Samsung phone, even the cheap ones are good. I have one with only 16gb of disk space (Samsung j5 prime, 2016 model) and I can install everything, except big games, but everything else works. With one of 32gb of space will be enough for everything else. A friend sent me a Chinese large-screen 'phone a few months ago, and I ended up doing repeated Android reinstalls. I'm not saying that the 'phone is particularly good or bad, but the experience highlighted the necessity of (a) selecting a 'phone for which firmware images are available and (b) making sure that the processor can always be put into a "coldstart" mode where it will accept a new firmware image (none of this "locked for your own protection" lark) and that a suitable upload program for your chosen PC OS is available. In this particular case the Phone was a King PPTV PP6000, the chip was Mediatek which has a low-level USB upload protocol baked in, and an uploader was available which ran on Linux provided that ModemManager was disabled. MarkMLl ---------------------------------------------------------------------- WayneSherman · 2021-06-05 05:07 Updated installation procedure to 2021-Jun-04 ver 1.4 (see first post) Changes: 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 Simplified folder structure so everything is self-contained in one folder. ($HOME/android)Using one-button LAMW install from FPCUPdeluxe. (works great, thanks DonAlfredo!)Removed old work-arounds which are no longer required.Add a new work-around for LAMW with NDK r22 and higher.Tested on newer OS (Xubuntu 20.04 64-bit)Using OpenJDK 11 (previously was using ver 8)All dev tools and utilities have been updated to more recent versions.No longer need FPC/Lazarus trunk, so using stable builds of both.Logout is no longer needed to set environment variables.Added optional script to setup environment for command line work. ---------------------------------------------------------------------- WayneSherman · 2021-06-05 14:39 Updated installation procedure to 2021-Jun-05 ver 1.5 (see first post) Changes: 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 Removed work-around for LAMW when using NDK revision >= 22.This has been fixed in the latest LAMW git code.(Work around was incorrect anyway since the API level was needed by LAMW, not the NDK revision) ---------------------------------------------------------------------- jmpessoa · 2021-06-05 15:51 Uptaded LAMW github! Thank you!! ---------------------------------------------------------------------- Windsurfer · 2021-10-08 13:42 Thanks for this guidance. Without it I would have spent weeks or months getting this far. I used fpcupdeluxe to install fpc + Lazarus + LAMW into an Android folder in my user folder. I could not compile without an error so followed these instructions. When I got to the point below, fpcupdeluxe had already created a tools folder. My question is: should there be a tools/cmdline-tools folder or a cmdline-tools/tools folder or both? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i # download and extract Android SDK Command Line Tools for Linux# from https://developer.android.com/studio/#downloadsmkdir -p "$HOME/android/sdk/cmdline-tools"cd "$HOME/android/sdk/cmdline- tools"wget "https://dl.google.com/android/repository/commandlinetools- linux-7302050_latest.zip"unzip "commandlinetools- linux-7302050_latest.zip"rm "commandlinetools- linux-7302050_latest.zip"mv cmdline-tools tools ---------------------------------------------------------------------- WayneSherman · 2021-10-08 14:50 Quote from: Windsurfer on October 08, 2021, 03:42:07 pmWhen I got to the point below, fpcupdeluxe had already created a tools folder. My question is: should there be a tools/cmdline-tools folder or a cmdline-tools/tools folder or both? It should be:  .../cmdline-tools/tools/ This can be seen from the next step (line 21): cd "$HOME/android/sdk/cmdline-tools/tools/bin" The tutorial assumes you are starting with an empty $HOME/android/ directory.  fpcupdeluxe is not used until after the command line tools have been installed. ---------------------------------------------------------------------- Windsurfer · 2021-10-09 06:59 Thanks very much. It is all working perfectly. ---------------------------------------------------------------------- guaracy · 2021-10-14 17:47 Maybe is better to use  xdg-user-dir than hardcoding "$HOME/Desktop/" directory. It handles localization of the filenames. Something like this: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i # note: the following lines must be copy/pasted as one line, starting at "cat" and ending at "EOF"cat < "`xdg-user-dir DESKTOP`/Android-Command- Line.desktop"[Desktop Entry]Type=ApplicationIcon=utilities- terminalExec=$HOME/android/set_dev_environmentName=Android-Command- LineTerminal=trueStartupNotify=falseEOFchmod +x "`xdg-user-dir DESKTOP`/Android-Command-Line.desktop" ---------------------------------------------------------------------- WayneSherman · 2021-10-18 16:30 Quote from: guaracy on October 14, 2021, 07:47:47 pmMaybe is better to use  xdg-user-dir than hardcoding "$HOME/Desktop/" directory. It handles localization of the filenames. I like it.  Fixed.  Thank you. ---------------------------------------------------------------------- laguna · 2021-10-19 07:17 AVD not start in ubuntu 18.04 help me Thanks Vincenzo ---------------------------------------------------------------------- WayneSherman · 2021-10-19 15:09 Quote from: laguna on October 19, 2021, 09:17:33 amAVD not start in ubuntu 18.04 help me I have not tested the emulator recently, but there are some instructions in the older "archived" how-to.  See post #3 in this same thread under the subheading "Installing and Using the Android Emulator". ---------------------------------------------------------------------- guaracy · 2021-10-20 00:03 Tested on Manjaro KDE 21.1.5  (Arch based distro) . Fresh install using VirtualBox. Just change apt install lines #7-#9 by Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i sudo pacman -S gtk2 jdk11-openjdk binutils make unzip gdb xterm Everything else remains the same. Line #29 to use fpcupdeluxe version v2.2.0c Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i wget "https ://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v2.2.0c/f pcupdeluxe-x86_64-linux" Better use xdg-user-dir in lines #47 and #48 Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i mv "$(xdg- user-dir DESKTOP)/fpcup-Lazarus_fpc-lazarus.desktop" "$(xdg-user-dir DESKTOP)/Lazarus-LAMW.desktop"sed -i "/^Name=/c\Name=Lazarus-LAMW" "$(xdg-user-dir DESKTOP)/Lazarus-LAMW.desktop" ---------------------------------------------------------------------- laguna · 2021-10-20 17:16 Not run Avdmanager, please help me. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema        at com.android.repository.a pi.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)      at com.android.repository.api.SchemaModule.(SchemaModule.java:75)      at com.android.sdklib.repository.AndroidSdkHandler.(Andro idSdkHandler.java:81)        at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)      at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200 )Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema        at java.base/jdk.internal.l oader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass (ClassLoaders.java:178)        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)      ... 5 more  thanks Vincenzo ---------------------------------------------------------------------- jmpessoa · 2021-10-20 19:01 QuoteNot run Avdmanager, please help me. Can you run in "real" device? ---------------------------------------------------------------------- laguna · 2021-10-21 06:18 I have remove java 11 now Run  on device  before remove java 11 the error not show but lazarus after run app show form for create avd but not open interface of create Thanks ---------------------------------------------------------------------- laguna · 2021-10-21 12:23 how do  clean installation? I've gotten to the point that the emulator starts up but the program doesn't install. The terminal window closes too quickly to read the error. Thanks ---------------------------------------------------------------------- WayneSherman · 2021-10-22 05:10 Quote from: guaracy on October 20, 2021, 02:03:01 amLine #29 to use fpcupdeluxe version v2.2.0c Better use xdg-user-dir in lines #47 and #48 Got it.  Fixed.  Thank you. ---------------------------------------------------------------------- WayneSherman · 2021-10-22 05:17 Updated installation procedure to 2021-Oct-21 ver 1.6 (see first post) Changes: 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 use $(xdg- user-dir DESKTOP) instead of hard-coded user Desktop path (thank you guaracy)Use newer Android Command-Line Tools for Linux build 7583922 (previous was 7302050)Use new FPCUPdeluxe ver 2.2.0c (previous was 1.8.2u)Compiled and tested simple hello world gui on Pixel 4 / Andriod 12  (tested both ARMv7a + VFPv3 and Aarch64)Tested the 32-bit APK using AVD/Emulator - system-images;android-24;default;armeabi-v7a ---------------------------------------------------------------------- laguna · 2021-10-22 05:45 Quote from: WayneSherman on October 22, 2021, 07:17:33 amUpdated installation procedure to 2021-Oct-21 ver 1.6 (see first post) Changes: 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 use $(xdg- user-dir DESKTOP) instead of hard-coded user Desktop path (thank you guaracy) bash: /home/scozzaro/Desktop: Is a directory    is ok?   Use newer Android Command-Line Tools for Linux build 7583922 (previous was 7302050) Please link for download?  Use new FPCUPdeluxe ver 2.2.0c (previous was 1.8.2u) I use this version (2.2.0c)  Compiled and tested simple hello world gui on Pixel 4 / Andriod 12  (tested both ARMv7a + VFPv3 and Aarch64) but avd manager not start, run with command line ./sdkmanager "platforms;android-29" "build-tools;29.0.3" "tools" "ndk- bundle" "extras;android;m2repository" path my command line: ~/android/sdk/cmdline-tools$                                     ~/android/sdk/cmdline-tools/tools$ and run with  ./emulator -avd ndk-bundle Thanks ---------------------------------------------------------------------- loaded · 2021-10-22 05:50 Why don't you use android studio emulator? However, they are now very fast and stable... ---------------------------------------------------------------------- laguna · 2021-10-22 06:07 how link lazarus with android studio emulator? how do to do?  thanks ---------------------------------------------------------------------- WayneSherman · 2021-10-22 06:21 Quote from: laguna on October 22, 2021, 07:45:34 amPlease link for download? Please see the first post in this message thread.  It has been updated with the latest procedure. Quote from: laguna on October 22, 2021, 07:45:34 ambut avd manager not start, run with command line I just tested the following and it worked: Installing and Using the Android Emulator: (the method described here uses the command line, another method is to install Android Studio) Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #Install the emulator and a system imagecd "$HOME/android/sdk/cmdline- tools/tools/bin"./sdkmanager "emulator" "system- images;android-24;default;armeabi-v7a"#(to get a list of system images use ./sdkmanager --list) #Create an android virtual devices (AVD)#(this particular device will work with 32-bit only)./avdmanager create avd -n "my_test_device" -k "system- images;android-24;default;armeabi-v7a" #(to get a list of devices use ./avdmanager list devices)#(after creation, AVD files are stored in:  ~/.android/avd/) #Run the emulatorcd "$HOME/android/sdk/emulator"./emulator -avd "my_test_device" # (to get a list of available AVDs, use ./emulator -list-avds)  For my test, I ran the emulator first.  Once the emulator is running, then from the Lazarus IDE menu select Run | [LAMW] Build Android Apk and Run Added notes on emulator testing: Testing in VirtualBox (enabled nested virtualization and 3D video) General Warning: Do not run the Android emulator as a "nested" virtual machine within another VM environment.  It can be done, but it has issues. If running inside a virtual machine, software rendering may be required.  Run the emulator with -gpu swiftshader_indirect. More info here. (Despite the warning above, this was tested in my VirtualBox AMD64 Linux VM) This worked for testing 32-bit ARM APKs:    system-images;android-24;default;armeabi-v7a    ./emulator -avd "my_test_device"   (in my current setup, this test did not require -gpu swiftshader_indirect) Emulator images that are native arm64-v8a are so slow I haven't gotten them to boot. For API 30 and later the x86 emulators emulate ARM when running on x86_64 host platform (reportedly 10 times faster than the native ARM emulators) 32-bit ARM APK works with system-images;android-30;google_apis;x86 32-bit and 64-bit APK works with system- images;android-30;google_apis;x86_64 ./emulator -avd "api30-x86-device" -no-snapshot-load -gpu swiftshader_indirect ./emulator -avd "api30-x86_64-device" -no-snapshot-load -gpu swiftshader_indirect For my testing with these two system images, the Android back and home buttons don't work and some system apps crash. (e.g. Settings) ---------------------------------------------------------------------- laguna · 2021-10-22 06:39 excuse me for bad english I had start from this post, but emulator not started, I had remove java 11, and work only java 8 with only java 8 the installation working I remove folder SDK and reinstall from you guide. Please wait for installation thanks a lot ---------------------------------------------------------------------- laguna · 2021-10-22 07:03 I have create this script Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i # Install libraries and toolssudo apt install -y libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev libxtst-dev libatk1.0-dev libghc-x11-dev freeglut3 freeglut3-devsudo apt install -y git subversion make build-essential gdb zip unzip unrar wgetsudo apt install -y openjdk-11-jdk android-tools-adb # download and extract Android SDK Command Line Tools for Linux# from https://developer.android.com/studio/#downloadsmkdir -p "$HOME/android/sdk/cmdline-tools"cd "$HOME/android/sdk/cmdline- tools"wget "https://dl.google.com/android/repository/commandlinetools- linux-7583922_latest.zip"unzip "commandlinetools- linux-7583922_latest.zip"rm "commandlinetools- linux-7583922_latest.zip"mv cmdline-tools tools # Install SDK packages and NDK (as of 2021-Oct-21 this pulls in NDK r22b)cd "$HOME/android/sdk/cmdline-tools/tools/bin"yes | ./sdkmanager --licenses./sdkmanager "platforms;android-29" "build-tools;29.0.3" "tools" "ndk-bundle" "extras;android;m2repository"  #Install the emulator and a system imagecd "$HOME/android/sdk/cmdline- tools/tools/bin"./sdkmanager "emulator" "system- images;android-24;default;armeabi-v7a"#(to get a list of system images use ./sdkmanager --list) #Create an android virtual devices (AVD)./avdmanager create avd -n "my_test_device" -k "system- images;android-24;default;armeabi-v7a" #(to get a list of devices use ./avdmanager list devices)#(after creation, AVD files are stored in:  ~/.android/avd/) #Run the emulatorcd "$HOME/android/sdk/emulator"./emulator -avd "my_test_device" # (to get a list of available AVDs, use ./emulator -list-avds) The emulator start after run script run on port 5556 is correct? but lazarus after complier not install app on emulator terminal windows show message error but close ealry  lazarus emulator window not show virtual machine create how image attachment ---------------------------------------------------------------------- loaded · 2021-10-22 10:48 Don't tire yourself so much, windows doesn't need any of this, it should be the same in linux  1- Install Android Studio 2- Make sure you can run the emulator from within Android Studio or using the launcher!!! Run it and keep it running. 3- Run your Android project using Lazarus and LAMW 4- Goto 2 ---------------------------------------------------------------------- laguna · 2021-10-22 13:20 I copy Sdk the Android Studio in sdk the lazarus I copy ndk-build in sdk now run in real device but non run in emulator device ---------------------------------------------------------------------- laguna · 2021-10-22 13:30 Finally run Start virtual machine emulator with Android Studio Not start with form the lazarus why are the controls not aligned as shown in the drawing? ---------------------------------------------------------------------- loaded · 2021-10-22 13:38 No, you should not copy. SDKs used by LAMW and Android Studio should be separate. So, Everyone should use their own SDK. Quote from: laguna on October 22, 2021, 03:30:32 pmwhy are the controls not aligned as shown in the drawing? On Android, the design is different. I recommend that you read it. https://developer.android.com/guide/topics/ui/declaring-layout ---------------------------------------------------------------------- laguna · 2021-10-22 13:45 Ok, no copy, but now run temporany aspetto di correre come mi hai detto Please post example alignment control Thanks. ---------------------------------------------------------------------- loaded · 2021-10-22 13:55 OK, I'm at work right now, I'll send you a sample when I get home (about 2 hours). ---------------------------------------------------------------------- WayneSherman · 2021-10-22 14:22 Quote from: laguna on October 22, 2021, 09:03:14 amThe emulator start after run script run on port 5556 is correct? but lazarus after complier not install app on emulator terminal windows show message error but close ealry lazarus emulator window not show virtual machine create how image attachment Are you compiling a 32-bit or 64-bit APK?  In my example, I used a 32-bit ARM emulator system image so I tested with a 32-bit APK. For the emulator listening port, the terminal output says "Started GRPC server at 127.0.0.1:8554, security: Local" On my test VM, I get the same "Android emulators" popup window only if I am not running the emulator already.  The "Refresh" and "AVD Manager" buttons don't do anything. ---------------------------------------------------------------------- loaded · 2021-10-22 15:44 Quote from: laguna on October 22, 2021, 03:30:32 pmwhy are the controls not aligned as shown in the drawing? A close example of what you want to do; https://cadplugin.com/other/AppLAMWProject1.rar For more control you should use the layout, it may take some trial and error. ---------------------------------------------------------------------- laguna · 2021-10-22 15:52 Ok Thank download run ---------------------------------------------------------------------- jmpessoa · 2021-10-22 17:07 Quotewhy are the controls not aligned as shown in the drawing? From here: https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/LAMW_Ge tting_Started.txt Quote[FAQ 2]: [Thanks to Ahmad Bohloolbandi (a.k.a. @developing) ] #Question: How do we can design a layout that shown same in real device? [Answer]: You should use the component properties:       "Anchor",       "PosRelativeToParent",       "PosRelativeToAnchor",       "LayoutParamHeight",       "LayoutParamWhidth"           Example: 1-Put a "jTextView" component on your AndroidModule form:    Set "PosRelativeToParent"       "rpCenterHorizontal" [True]       "rpTop" [True] 2-Put a "jButton" component on AndroidModule form:    Set "Anchor" to "jTextView" (Because you should set position relative with "jTextView")    set "PosRelativeToAnchor"       "raBelow" [True] 3-Put a "jEditText" component on form:    Set "Anchor" to "jButton".    Set "PosRelativeToAnchor"       "raBelow" [True] NOTE:    Anchor setting is most important section of this design,    because your component position depends on this property.    And for change width and/or height of each components you should    change/configure "LayoutParamWhidth" and/or "LayoutParamHeight". ---------------------------------------------------------------------- laguna · 2021-10-22 19:01 Thanks ---------------------------------------------------------------------- WayneSherman · 2022-05-01 21:02 Updated installation procedure to 2022-May-01 ver 1.7 (see first post in this thread) Changes: 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 Updated Android Command-Line Tools for Linux to build 8092744 (previous was 7583922)Updated Android SDK/API Level 31 (Android 12) (previous was 29)Updated Gradle 7.3.1 (previous was 6.8.3)Updated FPCUPdeluxe ver 2.2.0i (previous was 2.2.0c)Lazarus stable is now v2.2.0 (previous was v2.0.12)Add "sudo apt update" at the beginning for good measureInstead of installing "ndk-bundle" we now explicitly install "ndk;22.1.7171670"  (This provides more control of the NDK version, Google will update the ndk-bundle   version to NDK 23 at some point and LAMW is not ready for that yet)Remove the ini edit for "PrebuildOSYS=linux-x86_64" since LAMW detects that for us. ---------------------------------------------------------------------- WayneSherman · 2023-02-06 21:59 MOVED to Wiki: 2023-Feb-06 https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe ---------------------------------------------------------------------- WayneSherman · 2023-05-23 00:15 Updated: https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe Changes: 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 Added LAMW bug work-arounds for two cases:  1) Directly after creating a new project, save the project, close Lazarus, and re-open.  2) Directly after opening a demo project, save the project, close Lazarus, and re- open. Tested on more distro versions  xubuntu-20.04.6-desktop-amd64  xubuntu-22.04.2-desktop-amd64 (minimal install)  xubuntu-23.04-minimal-amd64 (NOTE: I will not usually test on non-LTS versions)  manjaro-xfce-22.1.2-minimal-230518-linux61 (based on arch linux) Manjaro does not have special issues with changing the LAMW project chipset - remove previous commentDon't explicitly install freeglut3 (it gets pulled in if needed by freeglut3-dev)Remove subversion from install packages (fpc and lazarus both use git now)Remove apache-ant from pacman (arch linux) install (fpcupdeluxe installs a private copy)Testing with updated software components:  fpcupdeluxe 2.2.0r  OpenJDK ver 11.0.19  Lazarus stable v2.2.6 Detailed Changes: https://wiki.freepascal.org/index.php?title=LAMW_install_linux_fpcupde luxe&type=revision&diff=156492&oldid=156484 ---------------------------------------------------------------------- WayneSherman · 2023-11-21 22:52 Updated 2023-Nov-21 ver 2.1: https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe Changes: 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 Add p7zip to package installation (fpcupdeluxe wants to use it)Update FPCUPdeluxe version to 2.4.0aAlso tested Android SDK api level 33Only tested on xubuntu-23.04-minimal-amd64 with aarch64 build Detailed Changes: https://wiki.freepascal.org/index.php?title=LAMW_install_linux_fpcupde luxe&type=revision&diff=157740&oldid=156493