Lazarus

Programming => Operating Systems => Android => Topic started by: Manlio on May 11, 2019, 10:15:09 pm

Title: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: Manlio on May 11, 2019, 10:15:09 pm
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!
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on May 11, 2019, 11:39:06 pm

Good question!

I will try some LAMW solution!

Thanks!
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on May 18, 2019, 10:30:48 pm
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!
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: WayneSherman on May 20, 2019, 03:37:13 am
Done!
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.

Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: ADiV on May 20, 2019, 06:36:35 pm
In windows does not work? or how would you have to configure it?
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on May 20, 2019, 08:00:19 pm
Quote
In 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           
                                                 
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
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: Manlio on June 28, 2019, 07:09:30 pm
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?
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: CC on June 30, 2019, 07:41:39 pm
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?
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on June 30, 2019, 08:03:06 pm
@Manlio

Quote
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.

"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

Quote
The 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!
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: CC on June 30, 2019, 08:09:56 pm
Thanks!
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: Robert Gilland on July 01, 2019, 04:46:02 am
Is that ready today or a month ago?
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on July 01, 2019, 05:21:39 am

LAMW? May 18, 2019 .....
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on July 12, 2019, 07:58:46 am
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/linux/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.msg313991.html#msg313991
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: ADiV on July 30, 2019, 09:06:41 am
aarch64 not work in windows with fpcupdeluxe!!
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on July 30, 2019, 05:44:32 pm

Quote
aarch64 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/how_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" ]


Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: Thaddy on July 30, 2019, 06:43:34 pm
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.
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: ADiV on July 30, 2019, 06:50:30 pm

Quote
aarch64 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/how_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.
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on July 30, 2019, 09:06:51 pm

if you choose "yes" what happens?  [usually it works ....]
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: ADiV on July 30, 2019, 09:20:02 pm
It crashes and never ends.
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on July 30, 2019, 09:53:18 pm
@Thaddy
Quote
There are some problems with older Android SDK versions when compiling for 64 bit

Here,  I tested using NDK18b (64bits) and it is OK...

@TR3E
Quote
It 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]   .... ???   
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: ADiV on July 31, 2019, 09:05:56 am
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.
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: jmpessoa on July 31, 2019, 04:53:23 pm
Quote
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 do not understand ... what do you recommend?
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: DonAlfredo on July 31, 2019, 05:04:55 pm
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.
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: ADiV on July 31, 2019, 05:45:41 pm
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.
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: DanielTimelord on August 01, 2019, 05:20:07 pm
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!
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: DanielTimelord on August 10, 2019, 08:50:33 pm
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.
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: DanielTimelord on August 21, 2019, 12:04:15 am
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 (https://github.com/DanielOliveiraSouza/LAMW4Linux-installer/blob/master/lamw_manager/docs/release_notes.md)
Title: Re: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy
Post by: svd71 on June 03, 2020, 11:18:19 pm
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!

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][+][-]
  1. Going to install a cross-compiler from available sources.
  2. Fpcupdeluxe: FPC cross-builder: Building compiler for android-aarch64.
  3. FPCUP(deluxe) is starting up.
  4.  
  5. Bootstrap dir:         /home/svd/fpcupdeluxe/fpcupdeluxe/fpcbootstrap
  6. FPCupdeluxe basedir:   /home/svd/fpcupdeluxe/fpcupdeluxe
  7. FPC URL:               https://svn.freepascal.org/svn/fpc/tags/release_3_0_4
  8. FPC options:          
  9. FPC source directory:  /home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc
  10. FPC install directory: /home/svd/fpcupdeluxe/fpcupdeluxe/fpc
  11. Lazarus URL:           https://svn.freepascal.org/svn/lazarus/tags/lazarus_2_0_4
  12. Lazarus options:      
  13. Lazarus directory:     /home/svd/fpcupdeluxe/fpcupdeluxe/lazarus
  14.  
  15. Please stand back and enjoy !
  16.  
  17. fpcupdeluxe: info: 3-6-20 23:07:18: fpcupdeluxe: V210 (20200401) started.
  18. fpcupdeluxe: info: FPCUPdeluxe V1.6.8k for x86_64-linux running on Linux Mint
  19. fpcupdeluxe: info: FPCCrossInstaller (CleanModule: FPC): Running make distclean twice (OS_TARGET=android/CPU_TARGET=aarch64)
  20. fpcupdeluxe: info: FPCCrossInstaller (CleanModule: FPC): Execute: make. Params: --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
  21. Executing: 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)
  22. Makefile:209: *** The Makefile doesn't support target aarch64-android, please run fpcmake first.  Stop.
  23. fpcupdeluxe: info: FPCCrossInstaller (CleanModule: FPC): Deleting [stray] executable: /home/svd/fpcupdeluxe/fpcupdeluxe/fpcsrc/compiler/ppc
  24. fpcupdeluxe: info: FPCCrossInstaller (BuildModule: FPC): Building module FPC...
  25. fpcupdeluxe: info: FPC aarch64-android cross-builder: Detected source version FPC (compiler): 3.0.4
  26. fpcupdeluxe: info: TAny_android-aarch64: Found correct binary utilities in directory /home/svd/fpcupdeluxe/fpcupdeluxe/cross/bin/aarch64-android
  27. fpcupdeluxe: info: TAny_android-aarch64: Found correct library in directory /home/svd/fpcupdeluxe/fpcupdeluxe/cross/lib/aarch64-android
  28. fpcupdeluxe: info: FPCCrossInstaller (BuildModuleCustom: FPC): Using FPC itself to compile and build the cross-compiler
  29. fpcupdeluxe: info: FPC aarch64-android cross-builder: Using compiler with version: 3.0.4
  30. fpcupdeluxe: info: FPCCrossInstaller (BuildModuleCustom: FPC): Removing fpc.cfg config snippet.
  31. 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.
  32. fpcupdeluxe: info: FPCCrossInstaller (InsertFPCCFGSnippet: fpc.cfg): Inserting snippet in /home/svd/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.cfg done.
  33. 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-android
  34. Executing: 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)
  35. Makefile:209: *** [b]The Makefile doesn't support target aarch64-android, please run fpcmake first.  Stop[/b].
  36. fpcupdeluxe: ERROR: [b]FPCCrossInstaller (BuildModuleCustom: FPC): Running cross compiler fpc make for aarch64-android failed with an error code.[/b]
  37.  
  38.  
  39. ERROR: Fpcupdeluxe fatal error !
  40. Building cross-tools failed ... ??? ... aborting.
  41.  

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".
TinyPortal © 2005-2018