Recent

Author Topic: LAMW Build Error - Windows  (Read 1211 times)

bsod

  • Newbie
  • Posts: 6
LAMW Build Error - Windows
« on: November 27, 2024, 01:37:26 pm »
I followed all the steps described in the installation documentation.

But i can't compile the android project with LAMW and laz4android2.2.2.

Error message:

Projeto:Executando comando anterior

Compile Reason: State file "C:\Sistemas\Android\HelloWord\obj\controls\controls.compiled" of Project is missing.


Executable:
C:\Sistemas\Android\HelloWord\jni\before_build.bat

CurrentDirectory:
C:\Sistemas\Android\HelloWord\jni\

Parameters:

Command Line:
C:\Sistemas\Android\HelloWord\jni\before_build.bat

Parsers: Exibir todas as linhas de saída

ProcessID:
46412

ExitCode:
1
ExitStatus:
1

Erro: Código saída 1
 

jmpessoa

  • Hero Member
  • *****
  • Posts: 2317
Re: LAMW Build Error - Windows
« Reply #1 on: November 27, 2024, 07:23:06 pm »

Hi, bsod!

don't run "before_build.bat"  and "after_build.bat"  by hand.....

Try compile and build apk using Lazarus/LAMW menu....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

bsod

  • Newbie
  • Posts: 6
Re: LAMW Build Error - Windows
« Reply #2 on: November 28, 2024, 12:24:03 am »
Hi jmpessoa,

I don't run the scripts by hand, i'm folowing the HelloWord App tutorial from documentation, and the error happen when i select Run > Build menu.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2317
Re: LAMW Build Error - Windows
« Reply #3 on: November 28, 2024, 01:32:08 am »

Can you put  here the "LAMW.ini"  from "laz4android2.2.2/config"?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

bsod

  • Newbie
  • Posts: 6
Re: LAMW Build Error - Windows
« Reply #4 on: November 29, 2024, 01:51:04 pm »
Hi jmpessoa,

Below the content of file:

[NewProject]
PathToSmartDesigner=c:\laz4android2.2.2\components\lazandroidmodulewizard\android_wizard\smartdesigner
PathToJavaTemplates=c:\laz4android2.2.2\components\lazandroidmodulewizard\android_wizard\smartdesigner\java
PathToAntBin=C:\Android\apache-ant-1.10.15\bin
PathToAndroidNDK=C:\Android\android-ndk-r21e
NDKRelease=21.4.7075529
NDK=5
PathToJavaJDK=C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot
PathToAndroidSDK=C:\Android\sdkJ21
PathToGradle=C:\Android\gradle-8.5
PrebuildOSYS=windows-x86_64
PathToWorkspace=C:\Sistemas\Android
InstructionSet=1
PackagePrefaceName=org.bsod

[JDKPaths]
0=C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot

[SDKPaths]
0=C:\Android\sdkJ21

[GradlePaths]
0=C:\Android\gradle-8.5

af0815

  • Hero Member
  • *****
  • Posts: 1381
Re: LAMW Build Error - Windows
« Reply #5 on: November 29, 2024, 03:34:07 pm »
BTW: Try to avoid using of pathnames with spaces or special characters
Code: Pascal  [Select][+][-]
  1. PathToJavaJDK=C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot
                                                  ^                    ^

Sometimes programms or scripts have trouble with the handling and splits the commands here.
« Last Edit: November 29, 2024, 03:36:04 pm by af0815 »
regards
Andreas

karnmedia

  • Newbie
  • Posts: 4
Re: LAMW Build Error - Windows
« Reply #6 on: December 15, 2024, 06:49:10 am »
How about new LAMW installation?

My fresh LAMW installation log.
-----------------------
Downloads
Laz4android3.4+fpc3.2.2.exe
android-ndk-r22b-windows-x86_64
apache-ant-1.10.15-bin
gradle-8.10.2-bin
openjdk-22+36_windows-x64_bin

Install
Install Laz4android3.4+fpc3.2.2.exe  on windows11Pro.
Install LAMW package via OPM.

Laz4Android
menu ->tools -> [LAMW] Android Module Wizard  -> path setting

JDK
C:\LazLAMW\openjdk-23+37_windows-x64_bin\jdk-23
ANT
C:\LazLAMW\apache-ant-1.10.15-bin\apache-ant-1.10.15\bin
GRADLE
C:\LazLAMW\gradle-8.11.1-bin\gradle-8.11.1
NDK
C:\LazLAMW\android-ndk-r22b-windows-x86_64\android-ndk-r22b
SDK
C:\Users\thoma\AppData\Local\Android\Sdk

menu ->tools -> [LAMW] Android Module Wizard  -> Build FPC Cross Android -> Build

select aarch64, then build, OK.

menu ->tools -> [LAMW] Android Module Wizard  -> Build FPC Cross Android -> Install

Path to FPC Source
C:\LazLAMW\fpcsrc

Path to FPC exe
C:\LazLAMW\fpc\bin\x86_64-win64

then install FPC Cross Android..

-----------------------

Update LAMW.

1. download the lastest LAMW Package from trunk.

2. extract to C:\laz4android3.4\config\onlinepackagemanager\packages

3. rename or delete the old LAMW folder and name the new one to LAMW.

4. menu ->tools -> [LAMW] Android Module Wizard  -> Build FPC Cross Android -> Build

select aarch64, then build, OK.

menu ->tools -> [LAMW] Android Module Wizard  -> Build FPC Cross Android -> Install

Path to FPC Unit.
C:\LazLAMW\fpc\units

Path to FPC exe.
C:\LazLAMW\fpc\bin\x86_64-win64

then Install.

menu -> tools -> clean and rebuild Lazarus IDE with normal profile.

5. Demo folder.
C:\laz4android3.4\config\onlinepackagemanager\packages\LAMW\demos



-----------------------
testing.

Laz4Android
Open a Demo projects
C:\laz4android3.4\config\onlinepackagemanager\packages\LAMW\demos\GUI\AppSqliteDemo4\jni\controls.lpi
open
C:\laz4android3.4\config\onlinepackagemanager\packages\LAMW\demos\GUI\AppSqliteDemo4\jni\unit1.pas


Project -> Project Options -> [LAMW] Android Project Options ->
   Change Min SDK Version to suite your needed. (22?)

-----------------------
Devices Connection.

on Android Studio -> Device Manager -> Pair Devices Using Wi-Fi.

On your Android Device
Setting->.... Developer options -> Wireless Debugging = On
 and then Pair device with QR Code.

Connected.

-----------------------

Menu -> Run -> [LAMW] Build anroid APK and Run

Done.

--------------------
Error occurs when try to build some old android project.

E: Manifest merger failed : android:exported needs to be explicitly specified for <receiver>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined.


open AndroidManifest.xml on the demo folder.
C:\laz4android3.4\config\onlinepackagemanager\packages\LAMW\demos\GUI\AppSqliteDemo4\AndroidManifest.xml

searching for something like ...

  <activity android:name="com.example.appsqlitedemo1.App ....." >

add android:exported="true"
 
  <activity android:name="com.example.appsqlitedemo1.App ..... android:exported="true" >
 
save the file and Lazarus -> Menu -> Run -> [LAMW] Build anroid APK and Run again.

Done.

--------------------------

Remark, I have tried android-ndk r23,r24,r25,r26,r27 with an error message dialog "directory doesn't exist. [1]!"
Downgrade to android-ndk v. 22  DONE.

« Last Edit: December 15, 2024, 06:57:35 am by karnmedia »

karnmedia

  • Newbie
  • Posts: 4
Re: LAMW Build Error - Windows
« Reply #7 on: December 15, 2024, 06:58:40 am »
How about new LAMW installation?

My fresh LAMW installation log.

-----------------------

Downloads
Laz4android3.4+fpc3.2.2.exe
android-ndk-r22b-windows-x86_64
apache-ant-1.10.15-bin
gradle-8.10.2-bin
openjdk-22+36_windows-x64_bin

Install
Install Laz4android3.4+fpc3.2.2.exe  on windows11Pro.
Install LAMW package via OPM.

Laz4Android
menu ->tools -> [LAMW] Android Module Wizard  -> path setting

JDK
C:\LazLAMW\openjdk-23+37_windows-x64_bin\jdk-23
ANT
C:\LazLAMW\apache-ant-1.10.15-bin\apache-ant-1.10.15\bin
GRADLE
C:\LazLAMW\gradle-8.11.1-bin\gradle-8.11.1
NDK
C:\LazLAMW\android-ndk-r22b-windows-x86_64\android-ndk-r22b
SDK
C:\Users\thoma\AppData\Local\Android\Sdk

menu ->tools -> [LAMW] Android Module Wizard  -> Build FPC Cross Android -> Build

select aarch64, then build, OK.

menu ->tools -> [LAMW] Android Module Wizard  -> Build FPC Cross Android -> Install

Path to FPC Source
C:\LazLAMW\fpcsrc

Path to FPC exe
C:\LazLAMW\fpc\bin\x86_64-win64

then install FPC Cross Android..

-----------------------

Update LAMW.

1. download the lastest LAMW Package from trunk.

2. extract to C:\laz4android3.4\config\onlinepackagemanager\packages

3. rename or delete the old LAMW folder and name the new one to LAMW.

4. menu ->tools -> [LAMW] Android Module Wizard  -> Build FPC Cross Android -> Build

select aarch64, then build, OK.

menu ->tools -> [LAMW] Android Module Wizard  -> Build FPC Cross Android -> Install

Path to FPC Unit.
C:\LazLAMW\fpc\units

Path to FPC exe.
C:\LazLAMW\fpc\bin\x86_64-win64

then Install.

menu -> tools -> clean and rebuild Lazarus IDE with normal profile.

5. Demo folder.
C:\laz4android3.4\config\onlinepackagemanager\packages\LAMW\demos

-----------------------

Testing.

Laz4Android
Open a Demo projects
C:\laz4android3.4\config\onlinepackagemanager\packages\LAMW\demos\GUI\AppSqliteDemo4\jni\controls.lpi
open
C:\laz4android3.4\config\onlinepackagemanager\packages\LAMW\demos\GUI\AppSqliteDemo4\jni\unit1.pas

Project -> Project Options -> [LAMW] Android Project Options ->
   Change Min SDK Version to suite your needed. (22?)

-----------------------

Devices Connection.

on Android Studio -> Device Manager -> Pair Devices Using Wi-Fi.

On your Android Device
Setting->.... Developer options -> Wireless Debugging = On
 and then Pair device with QR Code.

Connected.

-----------------------

Menu -> Run -> [LAMW] Build anroid APK and Run

Done.

--------------------
Error occurs when try to build some old android project.

E: Manifest merger failed : android:exported needs to be explicitly specified for <receiver>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined.

open AndroidManifest.xml on the demo folder.
C:\laz4android3.4\config\onlinepackagemanager\packages\LAMW\demos\GUI\AppSqliteDemo4\AndroidManifest.xml

searching for something like ...

  <activity android:name="com.example.appsqlitedemo1.App ....." >

add android:exported="true"
 
  <activity android:name="com.example.appsqlitedemo1.App ..... android:exported="true" >
 
save the file and Lazarus -> Menu -> Run -> [LAMW] Build anroid APK and Run again.

Done.

--------------------------

Remark, I have tried android-ndk r23,r24,r25,r26,r27 with an error message dialog "directory doesn't exist. [1]!"
Downgrade to android-ndk v. 22  DONE.

 

TinyPortal © 2005-2018