Recent

Author Topic: LAMW: 32 and 64 bit libraries in APK to comply with Google Play policy  (Read 6739 times)

Manlio

  • Full Member
  • ***
  • Posts: 162
  • Pascal dev
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!
manlio mazzon gmail

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296

Good question!

I will try some LAMW solution!

Thanks!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
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!
« Last Edit: May 18, 2019, 10:39:09 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

WayneSherman

  • Full Member
  • ***
  • Posts: 243
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.

« Last Edit: May 20, 2019, 07:30:21 pm by WayneSherman »

ADiV

  • Jr. Member
  • **
  • Posts: 90
    • ADiV Software
In windows does not work? or how would you have to configure it?

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
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           
                                                 
  • 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
« Last Edit: May 20, 2019, 09:06:14 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Manlio

  • Full Member
  • ***
  • Posts: 162
  • Pascal dev
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?
manlio mazzon gmail

CC

  • Full Member
  • ***
  • Posts: 149
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

  • Hero Member
  • *****
  • Posts: 2296
@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!
« Last Edit: June 30, 2019, 08:05:11 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

CC

  • Full Member
  • ***
  • Posts: 149
Thanks!

Robert Gilland

  • Full Member
  • ***
  • Posts: 160
Is that ready today or a month ago?

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296

LAMW? May 18, 2019 .....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
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
« Last Edit: July 12, 2019, 08:05:08 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

ADiV

  • Jr. Member
  • **
  • Posts: 90
    • ADiV Software
aarch64 not work in windows with fpcupdeluxe!!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296

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" ]


« Last Edit: July 30, 2019, 05:47:04 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018