LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy lazarus / 43-Android ---------------------------------------------------------------------- Manlio · 2019-05-11 20:15 In less than 3 months Google Play will require APKs to include both 32 and 64 bit version of .so libraries. https://developer.android.com/distribute/best-practices/develop/64-bit Is there going to be a way for LAMW to somehow handle that automatically? Or at least semi-automatically? Or can someone explain all the steps to prepare an APK with both 32 and 64 bit versions? Thanks! ---------------------------------------------------------------------- jmpessoa · 2019-05-11 21:39 Good question! I will try some LAMW solution! Thanks! ---------------------------------------------------------------------- jmpessoa · 2019-05-18 20:30 Done! Improved build for other chipset! How to get more ".so" chipset builds:    :: Warning 1: Your Lazarus/Freepascal needs to be prepared [cross- compile] for the various chipset builds!    :: Warning 2: Laz4Android [out-of-box] support only 32 Bits chipset: "armV6", "armV7a+Soft", "x86" 1. From LazarusIDE menu:    > Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK] 2. From LazarusIDE  menu:    > Run -> Clean up and Build... 3. From LazarusIDE menu:    > [LAMW] Build Android Apk and Run Thank You! ---------------------------------------------------------------------- WayneSherman · 2019-05-20 01:37 Quote from: jmpessoa on May 18, 2019, 10:30:48 pmDone! Improved build for other chipset! 1. From LazarusIDE menu:    > Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK] jmpessoa, well done.  I just tested on Xubuntu 18.04 (with aarch64 cross-compiler installed using Fpcupdeluxe).  It works with a simple test project (form and edit box).  Thanks for making those additions for 64-bit support. ---------------------------------------------------------------------- ADiV · 2019-05-20 16:36 In windows does not work? or how would you have to configure it? ---------------------------------------------------------------------- jmpessoa · 2019-05-20 18:00 QuoteIn windows does not work? or how would you have to configure it?  -->> Warning 2: Laz4Android [out-of-box] support only 32 Bits chipset: "armV6", "armV7a+Soft", "x86" .... I - Windows 1) Improve the Laz4Android distro...  [mid-term?] I am trying ....  Go to Lazarus IDE... menu "Tools" --> "[LAMW] Android Module Wizard"     --> Get FPC Source [Trunk]     --> Build FPC Cross Android                                                              Aarch64 Need tests!!  and  possibly fix some errors ...  [sorry...] 2) Building a new "Lazarus" environment using "Fpcupdeluxe"  and adding several/some cross-compiles II - Linux  [edited!] 1)How to by Wayne: https://forum.lazarus.freepascal.org/index.php/topic,40750.msg321687] 2) Building a new "Lazarus" environment using "Fpcupdeluxe"  and adding several/some cross-compiles ---------------------------------------------------------------------- Manlio · 2019-06-28 17:09 Hello On Windows, I can reach the point where I get Aarch64 cross Android compiled. But after that, I cannot make progress: If I change chipset in LAMW project properties, I get message that aarch64-android is not supported by fpc. I would also be happy with a command-line solution: Let's say that my code compiles normally with Lazarus 32-bit armeabi-v7a. What would I need to do to compile the same code via command line, using the Aarch64 cross compiler, which is now in the fpc/units/aarch64-android folder? Thank you so much for every possible help? ---------------------------------------------------------------------- CC · 2019-06-30 17:41 jmpessoa, The FPC trunk supports 64Bit but it has other issues. The latest reliable branch is 3.2 Fixes. Is this supposed to be suitable for all the  current android store requirements? ---------------------------------------------------------------------- jmpessoa · 2019-06-30 18:03 @Manlio QuoteOn Windows, I can reach the point where I get Aarch64 cross Android compiled. But after that, I cannot make progress: If I change chipset in LAMW project properties, I get message that aarch64-android is not supported by fpc. "fpc.exe" is only a wrapper .....  so some changes need to be made in the Laz4Android  configuration for this to work!  [maybe @TrueTom can help here....] @CC QuoteThe latest reliable branch is 3.2 Fixes. Is this supposed to be suitable for all the  current android store requirements? Yes! FPC is ready to android-aarch64"! and LAMW, too! ---------------------------------------------------------------------- CC · 2019-06-30 18:09 Thanks! ---------------------------------------------------------------------- Robert Gilland · 2019-07-01 02:46 Is that ready today or a month ago? ---------------------------------------------------------------------- jmpessoa · 2019-07-01 03:21 LAMW? May 18, 2019 ..... ---------------------------------------------------------------------- jmpessoa · 2019-07-12 05:58 Quote....Google Play will require APKs to include both 32 and 64 bit version of .so libraries. https://developer.android.com/distribute/best-practices/develop/64-bit Is there going to be a way for LAMW to somehow handle that automatically? Or at least semi-automatically? Or can someone explain all the steps to prepare an APK with both 32 and 64 bit versions? Prepare/build  FPC/Lazarus  for LAMW  using "fpcupdeluxe" ref. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases 1) Linux  [tutorial by @WayneSherman] https://github.com/jmpessoa/lazandroidmodulewizard/tree/master/docs/li nux/tutorial_by_waynesherman 2) Windows Download the tutorial [and unzip it!] from  here  [rtf format]:    https://od.lk/f/Ml8xNzA5ODY1NTVf 3) How to get more/others ".so" chipset builds:       .warning 1: Your Lazarus/Freepascal needs to be prepared [cross- compile] for the various chipset builds!    3.1. From LazarusIDE menu:          > Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK]    3.2. From LazarusIDE  menu:          > Run -> Clean up and Build...    3.3. From LazarusIDE menu:          > [LAMW] Build Android Apk and Run    NOTE: If desirable/wanted repeat 3.1/3.2/3.3 for other CPUs... Quote      .warning 2: Laz4Android2.0.0/Lazarus2.0.2' [out-of-box] support only 32 Bits chipset: "armV6", "armV7a+Soft", "x86"! A side note by @yuriy_sydorov "You need to use "fpc.exe" compiled from the trunk or 3.2 branch sources or invoke a cross-compiler binary directly.  fpc.exe 3.0.4 does not know than the android target supports 64-bit CPUs. Simply replace an existing fpc.exe by the new one." ref https://forum.lazarus.freepascal.org/index.php/topic,44117.msg3139 91.html#msg313991 ---------------------------------------------------------------------- ADiV · 2019-07-30 07:06 aarch64 not work in windows with fpcupdeluxe!! ---------------------------------------------------------------------- jmpessoa · 2019-07-30 15:44 Quoteaarch64 not work in windows with fpcupdeluxe!! Strange, a few days ago I did some testing and everything worked .... maybe some installability on trunk .... [remember, we need fpc 3.2 [beta] or up...] ref. https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/ho w_to_64bits_Apk.txt For windows we have the alternative of trying with a [canonical] preview of the Laz 2.0.2 + fpc3.2-beta ref. https://od.lk/f/Ml8xNzEyOTI1NDlf       [TUTORIAL II  -  "Do It Yourself" ] ---------------------------------------------------------------------- Thaddy · 2019-07-30 16:43 Last time I checked - minutes ago - both Aarch-linux and Android worked. There are some problems with older Android SDK versions when compiling for 64 bit, though, so choose a higher version. This is device dependent to some extend. ---------------------------------------------------------------------- ADiV · 2019-07-30 16:50 Quote from: jmpessoa on July 30, 2019, 05:44:32 pm Quoteaarch64 not work in windows with fpcupdeluxe!! Strange, a few days ago I did some testing and everything worked .... maybe some installability on trunk .... [remember, we need fpc 3.2 [beta] or up...] ref. https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/ho w_to_64bits_Apk.txt For windows we have the alternative of trying with a [canonical] preview of the Laz 2.0.2 + fpc3.2-beta ref. https://od.lk/f/Ml8xNzEyOTI1NDlf       [TUTORIAL II  -  "Do It Yourself" ] Attached image of the error you give me. ---------------------------------------------------------------------- jmpessoa · 2019-07-30 19:06 if you choose "yes" what happens?  [usually it works ....] ---------------------------------------------------------------------- ADiV · 2019-07-30 19:20 It crashes and never ends. ---------------------------------------------------------------------- jmpessoa · 2019-07-30 19:53 @Thaddy QuoteThere are some problems with older Android SDK versions when compiling for 64 bit Here,  I tested using NDK18b (64bits) and it is OK... @TR3E QuoteIt crashes and never ends. Here,  I tested "fpcupdeluxe-x86_64-win64.exe" and it is OK.. Can you try  "TUTORIAL II  -  Do It Yourself" [https://od.lk/f/Ml8xNzEyOTI1NDlf]   .... ??? ---------------------------------------------------------------------- ADiV · 2019-07-31 07:05 Finally I managed to install it, apparently it was because I used a different SSL. In the "ExtraSheet" tab download "Get OpenSSL by Browser" and if I let it install it. I think you should include this in the manual, before you start installing "fpcupdeluxe". Greetings and thanks. ---------------------------------------------------------------------- jmpessoa · 2019-07-31 14:53 QuoteFinally I managed to install it, apparently it was because I used a different SSL. In the "ExtraSheet" tab download "Get OpenSSL by Browser" and if I let it install it. I do not understand ... what do you recommend? ---------------------------------------------------------------------- DonAlfredo · 2019-07-31 15:04 Let me guess. Just yesterday, I added the Windows binary utilities for aarch64-android as a zip. Previously, only a rar-version was available. I guess this caused the issue: no unrar available on the system in use. Hope this helps. Greetings. ---------------------------------------------------------------------- ADiV · 2019-07-31 15:45 I thought I was using an erroneous SSL version that I searched online. Today download the fpcupdeluxe "Get OpenSSL by Browser" and unzip it into the fpcupdeluxe directory with which everything worked. I thought this was the mistake. The recommendation for the tutorial is that fpcupdeluxe needs "OpenSSL" and this step does not appear. Without it, the files cannot be downloaded at least in my case. Thank you DonAlfredo and jmpessoa for your great work. ---------------------------------------------------------------------- DanielTimelord · 2019-08-01 15:20 LAMW Manager v0.3.1-devel (for Linux) now supports AARCH64-Android     1) Download [and unzip]: https://github.com/DanielOliveiraSouza/LAMW4Linux- installer/archive/0.3.1-devel.zip     2) Install LAzarus + LAMW and all dependencies:        Go to directory lamw_manager and run:           ./lamw_manager If you want a clean install (or in case of failure) run: 2) ./lamw_manager --reset Note: 1) First Boot (after upgrading LAMW Manager from v0.3.0 to v0.3.1-devel) click on "Update-Info" on the first boot of the Lazarus IDE and then click on "Upgrade" Ready! ---------------------------------------------------------------------- DanielTimelord · 2019-08-10 18:50 The 0.3.1-devel branch (LAMW Manager with AARCH64 support) is stable and was merged into master (trunk) on 08/06/2019. Please download LAMW Manager from the Master branch. ---------------------------------------------------------------------- DanielTimelord · 2019-08-20 22:04 LAMW Manager v0.3.2 (to Linux) has has been released with important fixes for FPC and Lazarus.   For information on new features and bug fixes read the Release Notes https://github.com/DanielOliveiraSouza/LAMW4Linux- installer/blob/master/lamw_manager/docs/release_notes.md ---------------------------------------------------------------------- svd71 · 2020-06-03 21:18 Quote from: jmpessoa on May 18, 2019, 10:30:48 pmDone! Improved build for other chipset! How to get more ".so" chipset builds:    :: Warning 1: Your Lazarus/Freepascal needs to be prepared [cross- compile] for the various chipset builds!    :: Warning 2: Laz4Android [out-of-box] support only 32 Bits chipset: "armV6", "armV7a+Soft", "x86" 1. From LazarusIDE menu:    > Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK] 2. From LazarusIDE  menu:    > Run -> Clean up and Build... 3. From LazarusIDE menu:    > [LAMW] Build Android Apk and Run Thank You! Hi. 1. I had tried to install  the cross-compiling for aarch6-android  over fpcupdelux under Linix Mint x64 with follows report: 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 Going to install a cross-compiler from available sources.Fpcupdeluxe: FPC cross-builder: Building compiler for android-aarch64.FPCUP(deluxe) is starting up. Bootstrap dir:         /home/svd/fpcupdeluxe/fpcupdeluxe/fpcbootstrapFPCupdeluxe basedir:   /home/svd/fpcupdeluxe/fpcupdeluxeFPC URL:               https://svn.freepascal.org/svn/fpc/tags/release_3_0_4FPC options:         FPC source directory:  /home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrcFPC install directory: /home/svd/fpcupdeluxe/fpcupdeluxe/fpcLazarus URL:           https://svn.freepascal.org/svn/lazarus/tags/lazarus_2_0_4Lazarus options:       Lazarus directory:     /home/svd/fpcupdeluxe/fpcupdeluxe/lazarus Please stand back and enjoy ! fpcupdeluxe: info: 3-6-20 23:07:18: fpcupdeluxe: V210 (20200401) started.fpcupdeluxe: info: FPCUPdeluxe V1.6.8k for x86_64-linux running on Linux Mintfpcupdeluxe: info: FPCCrossInstaller (CleanModule: FPC): Running make distclean twice (OS_TARGET=android/CPU_TARGET=aarch64)fpcupdeluxe: info: FPCCrossInstaller (CleanModule: FPC): Execute: make. Params: --jobs=2,FPC=/home/svd/fpcupdeluxe/fpcupdeluxe/fpcbootstrap/ppcx64,--d irectory=/home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc,FPCMAKE=/home/svd/fp cupdeluxe/fpcupdeluxe/fpc/bin/x86_64- linux/fpcmake,PPUMOVE=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64 -linux/ppumove,FPCDIR=/home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc,PREFIX= /home/svd/fpcupdeluxe/fpcupdeluxe/fpc,INSTALL_PREFIX=/home/svd/fpcupde luxe/fpcupdeluxe/fpc,INSTALL_BINDIR=/home/svd/fpcupdeluxe/fpcupdeluxe/ fpc/bin/x86_64- linux,OS_TARGET=android,CPU_TARGET=aarch64,distcleanExecuting: make --jobs=2 FPC=/home/svd/fpcupdeluxe/fpcupdeluxe/fpcbootstrap/ppcx64 --directory=/home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc FPCMAKE=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/fpcmake PPUMOVE=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/ppumove FPCDIR=/home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc PREFIX=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc INSTALL_PREFIX=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc INSTALL_BINDIR=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux OS_TARGET=android CPU_TARGET=aarch64 distclean (working dir: /home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc)Makefile:209: *** The Makefile doesn't support target aarch64-android, please run fpcmake first.  Stop.fpcupdeluxe: info: FPCCrossInstaller (CleanModule: FPC): Deleting [stray] executable: /home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc/compiler/ppcfpcupdeluxe: info: FPCCrossInstaller (BuildModule: FPC): Building module FPC...fpcupdeluxe: info: FPC aarch64-android cross-builder: Detected source version FPC (compiler): 3.0.4fpcupdeluxe: info: TAny_android- aarch64: Found correct binary utilities in directory /home/svd/fpcupde luxe/fpcupdeluxe/cross/bin/aarch64-androidfpcupdeluxe: info: TAny_android-aarch64: Found correct library in directory /home/svd/fpc updeluxe/fpcupdeluxe/cross/lib/aarch64-androidfpcupdeluxe: info: FPCCrossInstaller (BuildModuleCustom: FPC): Using FPC itself to compile and build the cross-compilerfpcupdeluxe: info: FPC aarch64-android cross-builder: Using compiler with version: 3.0.4fpcupdeluxe: info: FPCCrossInstaller (BuildModuleCustom: FPC): Removing fpc.cfg config snippet.fpcupdeluxe: info: FPCCrossInstaller (InsertFPCCFGSnippet: fpc.cfg): Found existing snippet in /home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg. Replacing it with new version.fpcupdeluxe: info: FPCCrossInstaller (InsertFPCCFGSnippet: fpc.cfg): Inserting snippet in /home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg done.fpcupdeluxe: info: FPCCrossInstaller (BuildModuleCustom: FPC): Running make [step # st_Compiler] (FPC crosscompiler: aarch64-android) with CROSSOPT: -XPaarch64-linux-android- -Xd -Fl/home/svd/fpcupdeluxe/ fpcupdeluxe/cross/lib/aarch64-androidExecuting: make --directory=/home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc FPCMAKE=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/fpcmake PPUMOVE=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/ppumove FPCDIR=/home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc PREFIX=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc INSTALL_PREFIX=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc INSTALL_BINDIR=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux CROSSBINDIR=/home/svd/fpcupdeluxe/fpcupdeluxe/cross/bin/aarch64- android FPC=/home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.sh compiler_cycle CROSSINSTALL=1 CPU_SOURCE=x86_64 OS_SOURCE=linux OS_TARGET=android CPU_TARGET=aarch64 NOGDBMI=1 BINUTILSPREFIX=aarch64-linux-android- 'CROSSOPT=-XPaarch64-linux- android- -Xd -Fl/home/svd/fpcupdeluxe/fpcupdeluxe/cross/lib/aarch64-android' 'OPT=-vw-n-h-l-d-u-t-p-c- ' (working dir: /home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc)Makefile:209: *** [b]The Makefile doesn't support target aarch64-android, please run fpcmake first.  Stop[/b].fpcupdeluxe: ERROR: [b]FPCCrossInstaller (BuildModuleCustom: FPC): Running cross compiler fpc make for aarch64-android failed with an error code.[/b]  ERROR: Fpcupdeluxe fatal error !Building cross-tools failed ... ??? ... aborting.  2. Your sequence is wrong. if you do position 1 (" Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK]") it mean that you change a cpu and after it doing position 2 ("> Run -> Clean up and Build...")  you can get a message "illegal processor type".