Lazarus

Programming => Operating Systems => Android => Topic started by: Webdrifter on October 28, 2021, 10:35:19 pm

Title: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on October 28, 2021, 10:35:19 pm
Hello,

I want to make a client program for mobile phones.

I want to start with android as the target OS,
and maybe later when program catches on I want to have it run
on Windows and IOS also.

The clients have to communicate with a server program which I want to run on a windows 7 for now, since that is what I have running on my laptop. But later on it will have to run on Windows server 2019, and when it really catches on it will have to run on Linux or FreeBSD.

On the server I will have to run a PostgreSQL database.

The server will have tot create smartcontracts with the clients,
for this I wish to create a blockchain with Hyperledger Sawtooth.
I want to program this blockchain using DAML (and maybe I will also need to make use of Rosetta ?).

These contract must result in real payments between clients and server.
For this I would like to use Ethereum (and maybe bitcoin).

And as you can guess, I would like to work as much as possible using FreePascal (unless you all advise me it's better to use another language).

I have Freepascal, Lazarus, MS Visual Code and Android Studio installed on my laptop. I also have JRE 8.0.3110.11 (32- and 64-bit) and Gradle 7.2 installed. All of them installed using the free version of Chocolatey (standard install using the GUI).

Can you guys tell me please what for me would be the best way to go forward in preparing my laptop for this project (especially preparing Lazarus for Android)?

(I tried to read up on this in the forum and on the Wiki. But It only confuses me.)

Off course well explained Ideas on changing or improving the stack for this project are always welcome.

But mostly I need step by step plan for installing the needed stack in the best way!

Thanks in  advance. 
Title: Re: Preparing my Stack for Android and Blockchain
Post by: engkin on October 28, 2021, 11:51:21 pm
I would suggest LAMW:
https://github.com/jmpessoa/lazandroidmodulewizard

Read its LAMW_Getting_Started.txt
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on October 29, 2021, 11:07:51 pm
As said i had already installed:

.   Freepascal 3.0.4
.   Lazarus 2.0.12
.   MS Visual Code 1.61.2
.   Android Studio 2020.3.25
.   JRE 8.0.3110.11 (32- and 64-bit)
.   Gradle 7.2

I have now also installed (using Chocolatey):

.   Android SDK 26.1.1
.   Android NDK 21.5
.   Ant 1.10.12
.   NVM 1.1.5

https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/LAMW_Getting_Started.txt

Next speaks of 4 options:

.Option 1) Laz4Android
.Option 2) Fpcupdeluxe
.Option 3) LAMW Manager
.Option 4) Lazarus + FPC 3.2.0

Which should I choose (Considering my previously mentioned wishes and actions)?

Or should I first do something else?






Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on October 30, 2021, 12:49:54 am

Quote
Which should I choose ...

Any,  but:

 "LAMW Manager" will do a COMPLETE Laz4Android for you!
installing all necessary dependencies (JDK, SDK, GRADLE, ANT,  LAMW....!



Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on October 30, 2021, 02:16:25 pm

Quote
Which should I choose ...

Any,  but:

 "LAMW Manager" will do a COMPLETE Laz4Android for you!
installing all necessary dependencies (JDK, SDK, GRADLE, ANT,  LAMW....!

OK but as said above, I have most of that already installed through Chocolatey, and I wish to do that as much as possible.
Because this helps me to keep everything up to date more easily.

So from that point off view, what would be best next steps to take?

Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on October 30, 2021, 08:28:41 pm
The easiest "Option 1" : Laz4Android   (but only Android 32 bits  ....)

What about "Option 4"? (here you have full control over what you are doing! )

Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on October 31, 2021, 03:27:59 pm
Off course i want to support 64bit.
So option 4 seems great however in that case I will need at least FPC 3.2.0.
And as said above Chocolatey until now only has 3.0.4 in its package.

It is impossible to reach the maintainer of this package.
So I have asked the Chocolatey team to adopt the package and make
version 3.2.2 available. However they have not responded yet.

Maybe some hotshot within the FP community could use their leverage,
or maybe somebody within the FP community could take it upon himself to maintain this Chocolatey package?

(Sorry, I want to put all my time in the project mentioned above. And for now I would not even know how to maintain such a package).

Would it for now be a solution to install FP 3.2.0? Would that not mess up the possibility to easily update in the future once Chocolatey supports a newer version?




Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on October 31, 2021, 06:02:22 pm
Quote
So option 4 seems great however in that case I will need at least FPC 3.2.0......

Yes!  But NOW Lazarus 2.2  (canonical) comes ready with FPC 3.2.0!

So, you can try   "Option 4"  from here:

    "After install the LAMW packages [section II] go to:"
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on October 31, 2021, 08:11:20 pm
Sorry, I don't do release candidates, only final releases.

And as said above I already have Lazarus 2.0.12 installed.
I see that this comes with FPC 3.2.0, so that should be enough. Or not?

Which leaves me with the question: Do I need to keep Freepascal 3.0.4 installed next to Lazarus (as I have it right now) or is this redundant?
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on October 31, 2021, 08:45:42 pm
And how does this work:

II. LAMW: Lazarus Android Module Wizard
   .ref. https://github.com/jmpessoa/lazandroidmodulewizard/archive/master.zip
   
   .Packages Installations order.

      tfpandroidbridge_pack.lpk   [..../android_bridges]
      lazandroidwizardpack.lpk   [..../android_wizard]
      amw_ide_tools.lpk      [..../ide_tools]
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 01, 2021, 05:59:21 am

Quote
I see that this comes with FPC 3.2.0, so that should be enough.

Yes!

Quote
Do I need to keep Freepascal 3.0.4 installed next to Lazarus (as I have it right now) or is this redundant?

Yes, it is  redundant!

Quote
And how does this work:

Unzip it!  And do the packages Installations in that order :

      tfpandroidbridge_pack.lpk   [..../android_bridges]
      lazandroidwizardpack.lpk   [..../android_wizard]
      amw_ide_tools.lpk      [..../ide_tools]

Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 01, 2021, 10:59:49 pm
Thanks but how do I install those packages the proper way?

I started this thread in the beginners section. This had a reason.  ;)
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 02, 2021, 06:52:16 pm
Go to Lazarus menu:  "Package"  --> "Open Package File (*.lpk)"

and follow the pictures...   (repeat for all packages)
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 03, 2021, 12:15:32 am
When I try to compile, I get the next error:

Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 03, 2021, 09:42:22 pm

My test is OK (compile and install) !

What about put your LAMW folder in "C:\lazarus2012\components"   folder?
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 03, 2021, 11:45:33 pm
I get the same error !
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 04, 2021, 02:43:16 am
Quote
I get the same error !

Well,  I got Lazarus from oficial  site

https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.12/lazarus-2.0.12-fpc-3.2.0-win64.exe/download

I just do the installation without changing anything.... and it is OK for LAMW!


Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 04, 2021, 07:03:08 pm
I installed Lazarus with Chocolatey, and as far as I know they use the same source.

I really don't know why this goes wrong.
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 04, 2021, 07:13:09 pm
I did a reinstall of Lazarus with Chocolatey so you can see which source they use.
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 04, 2021, 11:44:52 pm
Quote
so you can see which source they use.

the same... from oficial  site

https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.12/lazarus-2.0.12-fpc-3.2.0-win64.exe/download


so possibly the information from some previous Lazarus installation is messing up your system....
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 05, 2021, 01:31:04 am
I tried it again. Failed.

Then I noticed that your folder name was /lazarus2012

While Chocolatey named mine just /lazarus

So I changed it. System made notice about possibly other install.
I went through, system probably made changes in environment variables.

Then I tried again. No luck. But got little bit different error.

So I changed back to /lazarus again (Because I did not want to confuse chocolatey with future updates).

Got the same message again about possible other install,system probably again changed environment variables.

Than I tried again. And guess what. Compiled without failure. Install also worked for all three packages. But did get several remarks. Like svn not being in the path. Hope this won't hurt, or do I need to make some extra adjustments.

Below you find the screens with remarks during compile and install of last of the 3 packages.

So what next to do...
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 05, 2021, 04:50:46 am
Quote
But did get several remarks.

Dont worry about remarks....

Quote
Like svn not being in the path. ...

Where? When trying to Get FPC [trunk] Source??? 
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 06, 2021, 11:39:18 am
I got the warning "svn not in path", as seen in picture above, during install of everyone of the 3 LAWM packages mentioned above.

So now I am trying to proceed with these steps in the process:

After install the LAMW packages [section II] go to:
         1. IDE "Tools" --> "[Lamw] Android Module Wizard" --> "Get FPC Source [Trunk]"
         2. IDE "Tools" --> "[Lamw] Android Module Wizard" --> "Build FPC Cross Android"

            [ex. Armv7a + Soft]   <<---- tested!
            .Build 
            .Install

            [ex. aarch64]        <<---- tested!
            .Build 
            .Install


I am now at the first of those 2 steps and get the screen attached to this message. What should I do here?

Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 06, 2021, 11:41:34 am
Also, I would like to say that I am very grateful to you for helping me in this whole process. Because I would not have succeeded on my own.

I did not expect that it would be so difficult to make Lazarus suitable for programming for such an important platform as Android.

In this way there is not a very good chance that we will win many new programmers for Pascal and Lazarus. Hope this thread will help.
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 06, 2021, 09:29:28 pm
Quote
What should I do here?

you can follow the suggestions:

1) A folder (any) to save FPC source from svn trunk

2) the svn path to fpc source [trunk] (default)

3) the path to [any] SVN command line client
   (you can download "SlikSvn"  from here "https://sliksvn.com/download/")

Quote
I did not expect that it would be so difficult to make Lazarus suitable for programming for such an important platform as Android.

Sorry....  but, yes:  "Lamw Manager" and others can be more automatic....

Title: Re: Preparing my Stack for Android and Blockchain
Post by: c4p on November 06, 2021, 10:19:06 pm
I also 100% recommend LAMW Manager too, works really well, and ensures you have the correct Gradle/Apache Ant versions etc.  :)

Quote
What should I do here?

you can follow the suggestions:

1) A folder (any) to save FPC source from svn trunk

2) the svn path to fpc source [trunk] (default)

3) the path to [any] SVN command line client
   (you can download "SlikSvn"  from here "https://sliksvn.com/download/")

Quote
I did not expect that it would be so difficult to make Lazarus suitable for programming for such an important platform as Android.

Sorry....  but, yes:  "Lamw Manager" and others can be more automatic....
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 06, 2021, 11:34:16 pm
I know, i am not taking the easiest route but still...

I installed Slik-Subversion-1.14.1-x64.msi
This without any problem.

Next I went back to Lazarus and tried to fulfil the next step.

And got an error. See attached picture.

Title: Re: Preparing my Stack for Android and Blockchain
Post by: dsiders on November 06, 2021, 11:47:55 pm
I know, i am not taking the easiest route but still...

I installed Slik-Subversion-1.14.1-x64.msi
This without any problem.

Next I went back to Lazarus and tried to fulfil the next step.

And got an error. See attached picture.

The error message is pretty self-explanatory. There is no SVN server at that address any more. The project(s) moved to git back in June-July.
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 07, 2021, 02:41:38 am
Quote
There is no SVN server at that address any more. The project(s) moved to git back in June-July.

Hi dsiders!

Please, can you point up to the new [direct] access to FPC source and how to download it?
Title: Re: Preparing my Stack for Android and Blockchain
Post by: dsiders on November 07, 2021, 02:56:48 am
Quote
There is no SVN server at that address any more. The project(s) moved to git back in June-July.

Hi dsiders!

Please, can you point up to the new [direct] access to FPC source and how to download it?


FPC source code is at:

https://gitlab.com/freepascal.org/fpc/source/-/tree/main

If you're looking for a specific version, the releases are all on source forge:

https://sourceforge.net/projects/freepascal/files/

Title: Re: Preparing my Stack for Android and Blockchain
Post by: Fred vS on November 07, 2021, 04:10:14 am
Quote
There is no SVN server at that address any more. The project(s) moved to git back in June-July.

Hi dsiders!

Please, can you point up to the new [direct] access to FPC source and how to download it?

In complement with dsiders answer there is also the direct access to the up-to-date last trunk zip file, ready to download:
https://gitlab.com/freepascal.org/fpc/source/-/archive/main/source-main.zip

And here of fixes 3.2:
https://gitlab.com/freepascal.org/fpc/source/-/archive/fixes_3_2/source-fixes_3_2.zip

And here of release 3.2.2:
https://gitlab.com/freepascal.org/fpc/source/-/archive/release_3_2_2/source-release_3_2_2.zip

Fre;D
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 07, 2021, 05:48:19 am
Hi, Webdrifter!

After the helps from dsiders and Fred vS (thanks to All!)

You can "bypass" this taks/form  [out of date]...

Get FPC source (unzip it!) and then go to the next task:

Quote
2. IDE "Tools" --> "[Lamw] Android Module Wizard" --> "Build FPC Cross Android"


Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 07, 2021, 03:51:52 pm
From the reactions above I understood, that when performing step

1. IDE "Tools" --> "[Lamw] Android Module Wizard" --> "Get FPC Source [Trunk]"


In the window at position "FPC Source Trunk Download"

I should not have :

http://svn.freepascal.org/svn/fpc/trunk


But I should now have to change it first to:

https://gitlab.com/freepascal.org/fpc/source/-/tree/main

So i tried this and got the next error.

Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 07, 2021, 09:27:20 pm
And I also don't understand why I would need FPC 3.2.2.

Did you not say earlier that FPC 3.2.2. was already in Lazarus 2.0.12?


And if this all means that step with SVN is unnecessary, then maybe installing sliksvn was a unnecessary step? And sliksvn can be uninstalled? Or not?
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 07, 2021, 09:43:53 pm
Quote
From the reactions above I understood, that when performing step

1. IDE "Tools" --> "[Lamw] Android Module Wizard" --> "Get FPC Source [Trunk]"

No! this step is "out of date" forget it!

Get FPC source as point up by "Fred Vs" and unzip it in some folder....... and then go to the next task:

2. IDE "Tools" --> "[Lamw] Android Module Wizard" --> "Build FPC Cross Android"

Quote
And I also don't understand why I would need FPC 3.2.2.

Did you not say earlier that FPC 3.2.2. was already in Lazarus 2.0.12?

You need FPC source code to produce the cross-compile to Android


Quote
And sliksvn can be uninstalled?

Yes!


Side note:
as soon as possible I will be updating the framework with this new information....
Thanks to All!

Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 09, 2021, 11:30:20 pm
OK, thanks. I am very busy for my work right now. So I will try tomorrow.
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 10, 2021, 11:35:17 pm

In the build tab I have to choose an FPC path.

I find the next paths to FPC 

C:\lazarus\fpc\3.0.4\bin\x86_64-win64
C:\lazarus\fpc\3.2.0\bin\x86_64-win64

Which one should I choose?

Do I need to have both on my PC?
Or can I just as well delete the 3.0.4 path?

I understood Lazarus 2.0.12 supported 3.2.2,
so Why is there no 3.2.2 path?

Is it wise to create such a path?
And if yes, how do I do that (Meaning how to get the right files and such in there)?

Next I am asked to choose an Architecture.

Which one should I choose?

Why do I have to choose it here, instead of everytime when I need to create a build of a program I made?

Can't you make your app work for more architectures then one?
(I don't see all kind off versions in the app-store for every single architecture)

Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 11, 2021, 02:44:18 am
Quote
In the build tab I have to choose an FPC path.

Get FPC source as point up by "Fred Vs" and unzip it in some folder.... that is the path!

Quote
Next I am asked to choose an Architecture.
Which one should I choose?

Code: Pascal  [Select][+][-]
  1.                         2. IDE "Tools" --> "[Lamw] Android Module Wizard" --> "Build FPC Cross Android"
  2.  
  3.                                 [ex. Armv7a + Soft]     <<---- tested!
  4.                                 .Build  
  5.                                 .Install
  6.  
  7.                                 [ex. aarch64]           <<---- tested!
  8.                                 .Build  
  9.                                 .Install
  10.  
  11.  
  12.                         3. After "build" and "install" the cross-compiler and before to create your first LAMW
  13. project
  14. .................. continue..........................
  15.  


Quote
Why do I have to choose it here,...

To make your FPC cross-compile to Android....

Quote
instead of everytime when I need to create a build of a program I made?

Yes, so will be.. 

Quote
Can't you make your app work for more architectures then one?

Yes, so will be.. 
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 11, 2021, 07:41:07 pm
Sorry, this is not what I had question about.
I understood that I had to unzip source in some folder and fill in that folder as path in first field "Path to FPD Source Code".

So I allready unzipped FPC source 3.2.2, placed it in folder and filled in the name of this folder in first field of window "FPC Android Croos compiler Builder"

In the second field I filled in path to NDK.
"C:\Android\android-ndk-r21e"

But Third path asks for "Path to FPC" 

As said for this I find 2 possibilities.

C:\lazarus\fpc\3.0.4\bin\x86_64-win64
C:\lazarus\fpc\3.2.0\bin\x86_64-win64

I don't see: C:\lazarus\fpc\3.2.2\bin\x86_64-win64
This confused me because I thought Lazarus 2.0.12 suppors FPC 3.2.2.

So as asked, which do I choose and is it not possible to get version FPC 3.2.2 for this.

By the way the files and the directory structure of the unzipped version 3.2.2 source code don't look anything like those in

C:\lazarus\fpc\3.0.4\bin\x86_64-win64
or
C:\lazarus\fpc\3.2.0\bin\x86_64-win64

So I was afraid to use the path to the source code in the third field.

Are you telling me I should use that path in third field?


Next you show me text with:

Suggesting I should make build for "Armv7a + Soft"
and for "aarch64"

But i can only choose one off those at once.

Do you mean to say I have to do the process twice, so once for each of those architectures?












Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 11, 2021, 08:06:31 pm
Quote
As said for this I find 2 possibilities.
C:\lazarus\fpc\3.0.4\bin\x86_64-win64
C:\lazarus\fpc\3.2.0\bin\x86_64-win64

Quote
This confused me because I thought Lazarus 2.0.12 suppors FPC 3.2.2.

No. So,  use: "C:\lazarus\fpc\3.2.0\bin\x86_64-win64"


Quote
So I was afraid to use the path to the source code in the third field.
Are you telling me I should use that path in third field?

No.  use: "C:\lazarus\fpc\3.2.0\bin\x86_64-win64"


Quote
Next you show me text with:
Suggesting I should make build for "Armv7a + Soft"
and for "aarch64"
But i can only choose one off those at once.
Do you mean to say I have to do the process twice, so once for each of those architectures?

Yes!



Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 12, 2021, 12:15:44 am
The first build with "Armv7a + Soft" gave lots of messages and warnings,
see text file attached.

Are those warnings reason for taking any actions from my part?

Anyway the build , ended with green bar of succes.

Install also went good.

The second build with "aarch64" gave no messages or warnings,
but build and install also ended with succes.

So time for the next step....
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 12, 2021, 12:17:48 am
Is it still necessary to take these steps:

3. After "build" and "install" the cross-compiler and before to create your first LAMW project

            [How to fix "Fatal: Cannot find unit system used by fcllaz of package FCL."]

            3.1) Go to "fpc.cfg"  [ex. "lazarus\fpc\3.2.0\bin"]

               Change:
 
               # searchpath for units and other system dependent things
               -FuC:\lazarus1864\fpc\$FPCVERSION/units/$fpctarget
               -FuC:\lazarus1864\fpc\$FPCVERSION/units/$fpctarget/*
               -FuC:\lazarus1864\fpc\$FPCVERSION/units/$fpctarget/rtl

               To:

               # searchpath for units and other system dependent things
               -FuC:\lazarus1864\fpc\3.2.0/units/$fpctarget
               -FuC:\lazarus1864\fpc\3.2.0/units/$fpctarget/*
               -FuC:\lazarus1864\fpc\3.2.0/units/$fpctarget/rtl

            3.2) Go to Lazarus IDE menu "Tools" --> "Options" --> "Environment" 

               [FPC Source]

               Change:
                  $(LazarusDir)fpc\$(FPCVer)\source
               To:
                  $(LazarusDir)fpc\3.2.0\source
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 12, 2021, 04:19:25 am

Good work!

Congratulations!!!
Title: Re: Preparing my Stack for Android and Blockchain
Post by: ccrause on November 12, 2021, 08:26:21 am
Is it still necessary to take these steps:

3. After "build" and "install" the cross-compiler and before to create your first LAMW project

            [How to fix "Fatal: Cannot find unit system used by fcllaz of package FCL."]

            3.1) Go to "fpc.cfg"  [ex. "lazarus\fpc\3.2.0\bin"]

               Change:
 
               # searchpath for units and other system dependent things
               -FuC:\lazarus1864\fpc\$FPCVERSION/units/$fpctarget
               -FuC:\lazarus1864\fpc\$FPCVERSION/units/$fpctarget/*
               -FuC:\lazarus1864\fpc\$FPCVERSION/units/$fpctarget/rtl

               To:

               # searchpath for units and other system dependent things
               -FuC:\lazarus1864\fpc\3.2.0/units/$fpctarget
               -FuC:\lazarus1864\fpc\3.2.0/units/$fpctarget/*
               -FuC:\lazarus1864\fpc\3.2.0/units/$fpctarget/rtl

            3.2) Go to Lazarus IDE menu "Tools" --> "Options" --> "Environment" 

               [FPC Source]

               Change:
                  $(LazarusDir)fpc\$(FPCVer)\source
               To:
                  $(LazarusDir)fpc\3.2.0\source

A good question, since the compiler should expand the $FPCVERSION macro to its own version.  Similarly the Lazarus macro $(FPCVer) should expand to the selected compiler version.

Typically these macros work, which is why they are often used in configurations.  Perhaps this was to work around some other issue, maybe cross compiler specific?
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 12, 2021, 10:47:26 pm
I hope someone can answer my question about step three.
Because I would like to know how to proceed.

Also I saw that I forget to include the text with the warnings I got during build. So here it comes, maybe of interest for the specialists on this forum.
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 13, 2021, 12:19:22 am
Quote
Is it still necessary to take these steps...

As point up by @ccrause, May be not!

Skip this step and try go ahead ....
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 14, 2021, 06:56:45 pm
When it comes to computers and programming I don't really like "Maybe's".
Since computers and programs usually don't seem to "understand" them...
So if anyone knows for sure, this would help make me feel more comfortable.

In the meantime next in the "Getting_Started.txt" is this remark:

IMPORTANT!
   Google Play NOW require APKs to include both 32 and 64 bit version of .so libraries....
   ref.  https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/how_to_64bits_Apk.txt

So should I now first take the steps described in:
https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/how_to_64bits_Apk.txt

before moving on with other steps in "Getting_Started.txt".

Or not?


Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 14, 2021, 08:10:44 pm

As you already has prepared to cross-compile to  ""aarch64"

go to:

Quote
4) How to get more/others ".so" chipset builds:
   
   .warning: Your Lazarus/Freepascal needs to be prepared [cross-compile] for the various chipset builds!

   4.1. From LazarusIDE menu:
      > Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK]
   4.2. From LazarusIDE  menu:
      > Run -> Clean up and Build...
   4.3. From LazarusIDE menu:
      > [LAMW] Build Android Apk and Run

   NOTE: If desirable/wanted repeat 4.1/4.2/4.3 for other CPUs...

Quote
When it comes to computers and programming I don't really like "Maybe's"....

Nobody likes it, however, due to constant changes in the programming environments, things that used to work [often] stop working and we have to adapt to this idea....
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 22, 2021, 10:08:46 pm
(Sorry for reaction this late. I was out of the country for my work. May happen again ;))

I tried this.

At step 4.1 I got the choice between "Ant" and "Gradle" as APK-builder.
I have both installed with Chocolatey. I chose "Ant".

As chipset I chose: ARMv7a+Soft

Since this was one off the two chipsets I did build for earlier in this process.

I pressed OK. Window disappeared. So I guess, no problem.

I went to step 4.2 and did "Clean up and Build"

Got a lot off messages, and lots went successful until...

I got error. See attached picture. 


(by the way if we can get this to work, do I have to do the cycle again with other chipset "aarch64", which I also did build for earlier in this process)
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Insid3Code on November 22, 2021, 10:59:41 pm
According to the picture I see that you are trying to compile windows executable instead of a shared object file (.so)...

Go to Project -> New Project -> LAMW[GUI] Android Module
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Fred vS on November 22, 2021, 11:03:41 pm
Hello.

In your error message, the compiler try to access files in a temp directory..

Maybe try to first save your project in a directory with write permission, for example in your user directory.
And then re-compile the project from that directory.
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 22, 2021, 11:22:16 pm

Did you skip:

"III. USING LAMW"  ?
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on November 24, 2021, 12:51:44 am
I am not working on a project yet.

I am still trying to prepare my stack so I can program a blockchain application for android.

I am still following the "Getting_Started.txt" for this.

I am now at the step that refers to a procedure described in
the file "https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/how_to_64bits_Apk.txt"

JMpessoa mentioned steps from that file above:

 4.1. From LazarusIDE menu:
      > Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK]
   4.2. From LazarusIDE  menu:
      > Run -> Clean up and Build...
   4.3. From LazarusIDE menu:
      > [LAMW] Build Android Apk and Run

And I tried this but failed.

I am not even near step "III. USING LAMW".

I have done nothing more than what I described in this thread.

As far as I know this referral to file "how_to_64bits_Apk.txt" was way above step "III. USING LAMW" . While now I find it far below that step.

It seems that somebody has changed the "getting started.txt" file in the meantime. Text and numbers have changed. So now I am extremely confused. How to proceed?




Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 24, 2021, 01:09:37 am
Quote
I am not even near step "III. USING LAMW"....

But are you ready to go "III. USING LAMW".....


After that You complete this step (How to get more/others ".so" chipset builds):
Quote
4.1. From LazarusIDE menu:
      > Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK]
   4.2. From LazarusIDE  menu:
      > Run -> Clean up and Build...
   4.3. From LazarusIDE menu:
      > [LAMW] Build Android Apk and Run

I will update the doc again!  [edited: Done!]

Thank you!
Title: Re: Preparing my Stack for Android and Blockchain
Post by: nick1965 on November 29, 2021, 12:17:07 am
hi there is it any way for someone to get paid and to help an old man to  install lazarus on windows
with cross compike for android and linux?

i try everything and anything
my last change is the lamw manager which is installing things now.
i dont think is going to work either
Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on November 29, 2021, 12:42:32 am

Hi, nick1965!

Yes,  "lamw manager"  is a good choice ((for install cross-android compiler and all LAMW stuff/requirements)!


But,  it has some issues when handling Windows 7...

If you need "All in One" (Android + Linux cross compilers)  there is only one choice: "fpcupdeluxe"

Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on December 06, 2021, 09:45:46 pm
Quote
I am not even near step "III. USING LAMW"....

But are you ready to go "III. USING LAMW".....


After that You complete this step (How to get more/others ".so" chipset builds):
Quote
4.1. From LazarusIDE menu:
      > Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK]
   4.2. From LazarusIDE  menu:
      > Run -> Clean up and Build...
   4.3. From LazarusIDE menu:
      > [LAMW] Build Android Apk and Run

I will update the doc again!  [edited: Done!]

Thank you!


I  really don't understand this. As said: I am not even near step "III. USING LAMW"....

So why would I be ready to go to "III. USING LAMW".....

I really appreciate your effort to help me out, and it surprises me you stuck with me this far, because I can assure you that I am getting more and more discouraged.

Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on December 06, 2021, 11:07:14 pm
Quote
I am not even near step "III. USING LAMW"....

Can you, please, say what tasks you have completed?
Title: Re: Preparing my Stack for Android and Blockchain
Post by: Webdrifter on December 07, 2021, 01:37:29 pm
As you can see in all the above.

The latest I managed to succeed with is this step:

IDE "Tools" --> "[Lamw] Android Module Wizard" --> "Build FPC Cross Android"
 
                                [ex. Armv7a + Soft]     <<---- tested!
                                .Build 
                                .Install
 
                                [ex. aarch64]           <<---- tested!
                                .Build 
                                .Install


I asked this about the next step I found:
Is it still necessary to take these steps:

3. After "build" and "install" the cross-compiler and before to create your first LAMW project

            [How to fix "Fatal: Cannot find unit system used by fcllaz of package FCL."]

            3.1) Go to "fpc.cfg"  [ex. "lazarus\fpc\3.2.0\bin"]

               Change:
 
               # searchpath for units and other system dependent things
               -FuC:\lazarus1864\fpc\$FPCVERSION/units/$fpctarget
               -FuC:\lazarus1864\fpc\$FPCVERSION/units/$fpctarget/*
               -FuC:\lazarus1864\fpc\$FPCVERSION/units/$fpctarget/rtl

               To:

               # searchpath for units and other system dependent things
               -FuC:\lazarus1864\fpc\3.2.0/units/$fpctarget
               -FuC:\lazarus1864\fpc\3.2.0/units/$fpctarget/*
               -FuC:\lazarus1864\fpc\3.2.0/units/$fpctarget/rtl

            3.2) Go to Lazarus IDE menu "Tools" --> "Options" --> "Environment"

               [FPC Source]

               Change:
                  $(LazarusDir)fpc\$(FPCVer)\source
               To:
                  $(LazarusDir)fpc\3.2.0\source

(However, in the meanwhile somebody seems to have changed the getting started, which now has the following text above this step:

Hint:  After "build" and "install" the cross-compilers and all "II. Infrastructure" 
go to "III. USING LAMW" and try to create your first [New] LAMW project!
If you get a error "Fatal: Cannot find unit system used by fcllaz of package FCL."
when trying "Run" --> "Build"  your project try fix the "fpc.cfg" file:

Which confuses me)



Nex You said: Skip this step and try go ahead ....

I said:
In the meantime next in the "Getting_Started.txt" is this remark:

IMPORTANT!
   Google Play NOW require APKs to include both 32 and 64 bit version of .so libraries....
   ref.  https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/how_to_64bits_Apk.txt

So should I now first take the steps described in:
https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/how_to_64bits_Apk.txt

before moving on with other steps in "Getting_Started.txt".

Or not?

You Said:
go to:

Quote
4) How to get more/others ".so" chipset builds:
   
   .warning: Your Lazarus/Freepascal needs to be prepared [cross-compile] for the various chipset builds!

   4.1. From LazarusIDE menu:
      > Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK]
   4.2. From LazarusIDE  menu:
      > Run -> Clean up and Build...
   4.3. From LazarusIDE menu:
      > [LAMW] Build Android Apk and Run

   NOTE: If desirable/wanted repeat 4.1/4.2/4.3 for other CPUs...

I tried and failed:

At step 4.1 I got the choice between "Ant" and "Gradle" as APK-builder.
I have both installed with Chocolatey. I chose "Ant".

As chipset I chose: ARMv7a+Soft

Since this was one off the two chipsets I did build for earlier in this process.

I pressed OK. Window disappeared. So I guess, no problem.

I went to step 4.2 and did "Clean up and Build"

Got a lot off messages, and lots went successful until...

I got error. See attached picture.

So that's where I am at












Title: Re: Preparing my Stack for Android and Blockchain
Post by: jmpessoa on December 07, 2021, 01:46:17 pm
Quote
in the meanwhile somebody seems to have changed the getting started

Yes! Follow the new version! 
Title: Re: Preparing my Stack for Android and Blockchain
Post by: dseligo on December 07, 2021, 02:32:02 pm
I got error. See attached picture.

What error did you get?
You didn't attach picture.
TinyPortal © 2005-2018