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: TR3E 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: TR3E 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: TR3E 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: TR3E 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: TR3E 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: TR3E 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 v.0.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)