jmpessoa / lazandroidmodulewizard

LAMW: Lazarus Android Module Wizard: Form Designer and Components development model!
246 stars 82 forks source link

Packages android_wizard and ide_tools don't compile #519

Open Vlastik-V opened 6 months ago

Vlastik-V commented 6 months ago

I've just tried to install LAMW via fpcdeluxe (and then also directly via OPM) and the installation failed. The problem comes from: (Github download on 03.02.2024)

1) unit android_wizard/LamwDesigner.pas, line 2194:

  "if AComponent.Name.StartsWith(AComponent.ClassName then"
      Temporary workaround:
  "if string(AComponent.Name).StartsWith(AComponent.ClassName) then"

2) unit ide_tools/GDBMIServerDebuggerLAMW.pas:

  'Identifier not found "dsError"'   (also other dsXxxx constants)
     Patch:
  "implementation
   uses Forms, Laz2_XMLCfg, **_LazDebuggerIntfBaseTypes_**; unit missing => added"

Unfortunately these patches doesn't help when installing LAMW with fpcdeluxe, because the units/packages are always fresh downloaded from their repository and the installation proceudre always fails

marcos-ebm commented 6 months ago

[using the translator]

what operating system are you using?

The most current version to be able to install LAMW is version 2.2.2 for Windows only

if you try to install LAMW on Lazarus 3 for example, it will cause errors

Vlastik-V commented 6 months ago

Hi,

I am using Win 10 Pro 22H2 64-bit. For the LAMW installation I used fpcdeluxe 2.4.0c (latest), there is a dedicated button [LAMW] in fpcdeluxe to perform complete FPC +Lazarus + LAMW + cross compilers + ant + gradle installation. It installs FPC 3.2.2 + Lazarus 3.0 versions, but there shouldn't be any problem with the veriosn according to what I tried, I think.

There is just one really small issue in the source code of the "ide_tools package" unit, which causes it doesn't compile. It is in the "ide_tools/GDBMIServerDebuggerLAMW.pas" unit, where "LazDebuggerIntfBaseTypes" unit is missing in the "implementation, uses" section. And it causes that the enumeration items of TDBGState = ( dsNone, dsIdle, ... ) are unknown during compilation. It is not connected to any particular version of FPC, Lazrus nor OS.

I downloaded the sources from your github and tried to install the packages directly in Lazarus and it showed me the problem - and how to solve it. After I have corrected the source code I was even able to instal all LAMW packages in the latest trunk (64-bit) version of FPC and Lazarus.

The issue with "GDBMIServerDebuggerLAMW.pas" is most probably general and I think it will cause compilation errors in all version of FPC, since it is a required unit. Therefore the compiler does not know about the identifiers declared in the "LazDebuggerIntfBaseTypes.pas" unit (dsError, etc.) and which are used in GDBMIServerDebuggerLAMW.pas and not mentioned in its "uses" section.

The problem with "LamwDesigner.pas" is different and it is most probably connected to the latest trunk version of FPC. So it doesn't cause any problem with the fpcdeluxe-LAMW installation. And it is not necessary to solve it now. It is just good to know that it will cause problems in higher compiler versions (string helper incompatibility with TComponentName which I "workarounded" by hard-typecasting to string).

marcos-ebm commented 6 months ago

let's wait for Marques (creator of LAMW) to help you

In the meantime, you can do a test, this is the way I like to install Lamw

follow the procedures in Option A from the main link https://github.com/jmpessoa/lazandroidmodulewizard

I've never had errors doing it this way, but you'll be using version 2.2.2 (which isn't that bad lol)

I created an android folder in c:\

in it I put the folders NDK 21.E ..... JDK 21 ..... ANT ....GRADLE 8.5, SDK and the lazandroidmodulewizard folder

then in Path Settings, I pointed to these folders

try to do this.

Captura de Tela 2024-02-03 às 11 44 28

Captura de Tela 2024-02-03 às 11 45 32

Captura de Tela 2024-02-03 às 11 46 28

Captura de Tela 2024-02-03 às 11 47 15

Vlastik-V commented 6 months ago

Ok, I understand. And thank you for your help and for your prompt answer!

jmpessoa commented 6 months ago

Fixed!

@Vlastik-V, please, test it!

Thanks to All!

Vlastik-V commented 6 months ago

Hi Jose, everything works just fine, thank you ;-) !

I tried fpcdeluxe/LAMW install - no problem (64-bit FPC 3.2.2 + Laz 3.0).

I tried to install LAMW via Online Package Manager into 64-bit FPC 3.3.1/trunk + Laz 3.99/trunk and it worked too. But I had to download LAMW from your GitHub manually and put it into my local OPM directory, because OPM LAMW remote download doesn't work, it fails. And I also checked the remote OPM repository and discovered, that there is some old LAMW version. And the option for download from external (let's say your) repositiry doesn't work neither.

https://packages.lazarus-ide.org/

So could' you, please, update the repository - for other developers to be able to install the LAMW packages via OPM?

Of course, it is possible to download the LAMW packages from your GitHub and install them manually, but using OPM is more comfortable and it makes life easier for less advanced Lazarus users :-).

Thank you!

jmpessoa commented 6 months ago

Yes!

I send a update request to OPM at opm@lazarus-ide.org !

Thank you!

Vlastik-V commented 6 months ago

Perfect, thank you!

jmpessoa commented 6 months ago

Done!

Thanks to All!

Vlastik-V commented 6 months ago

Great, thank you!