Recent

Author Topic: LAMW Install not working  (Read 1280 times)

petex

  • Jr. Member
  • **
  • Posts: 81
LAMW Install not working
« on: October 31, 2024, 02:08:27 pm »
I installed using the manager vs 0.8.6.4 for Windows.

I opened the "hello world" app and it would not build. See error log:

Quote
...............................
Project: Executing command before: Success
before build...
Compile Project, OS: android, CPU: arm, Target: C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\libs\armeabi-v7a\libcontrols.so: Exit code 1, Errors: 1
Fatal: Cannot find system used by controls. Make sure all ppu files of a package are in its output directory. ppu in wrong directory=C:\lazarusAndroid\LAMW\LAMW4Windows\fpc\3.2.0\units\arm-android\rtl\system.ppu..


nobody.00

  • New Member
  • *
  • Posts: 14
Re: LAMW Install not working
« Reply #1 on: October 31, 2024, 04:21:31 pm »

petex

  • Jr. Member
  • **
  • Posts: 81
Re: LAMW Install not working
« Reply #2 on: October 31, 2024, 08:19:54 pm »
It mentions "Android project Options", these are not present on the Lazarus IDE 2.0.12


Quote
Cannot Build LAMW Demos

By default LAMW Manager uses (Android) Crosscompile to ARMv7+vFPV3, but LAMW Demos uses ARMV6+Cfsoft, you need apply this configuration:

    Open your LAMW Demo with LAMW4Windows
    On menu bar go to Project --> Project Options ... --> [LAMW] Android Project Options --> Build --> Chipset --> ARMV7a+FVPv3


If I try and create a new (empty) GUI project it is worse ......

Quote
Messages
Verbose: Selected chip architecture: armeabi-v7a
Verbose: Taking libraries from folder: C:\Users\peter\Dev\LAMWProjects\AppLAMWProject1\libs\armeabi-v7a
Project: Executing command before: Success
before build...
Compile Project, OS: android, CPU: arm, Target: C:\Users\peter\Dev\LAMWProjects\AppLAMWProject1\libs\armeabi-v7a\libcontrols.so: Exit code 1, Errors: 1
C:\lazarusAndroid\LAMW\sdk\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.bfd.exe: cannot find -ldl
C:\lazarusAndroid\LAMW\sdk\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.bfd.exe: cannot find -ljnigraphics
C:\lazarusAndroid\LAMW\sdk\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.bfd.exe: cannot find -lc
controls.lpr(731,15) Error: Error while linking

af0815

  • Hero Member
  • *****
  • Posts: 1379
Re: LAMW Install not working
« Reply #3 on: October 31, 2024, 09:22:31 pm »
It mentions "Android project Options", these are not present on the Lazarus IDE 2.0.12
I have Lazarus 3.0 (rev lazarus_3_0) FPC 3.2.2 i386-win32-win32/win64 with LAMW here (is also a older install). Lazarus 2.0.12 look a little outdated.

How have you installed your version ?
regards
Andreas

petex

  • Jr. Member
  • **
  • Posts: 81
Re: LAMW Install not working
« Reply #4 on: October 31, 2024, 09:34:32 pm »
i just installed the latest from github - LAMW manager. Its meant to be a hands free install. I haven't intervened.
I really don't know what is the best approach as there are several alternatives. I am sure its all good stuff but it really appears to be so flaky.

petex

  • Jr. Member
  • **
  • Posts: 81
Re: LAMW Install not working
« Reply #5 on: November 01, 2024, 02:39:26 pm »
I installed using fpcdeluxe by pressing the green LAMW button. This version of lazarus has all the Android options that were missing from the LAMW manager install. I tried to compile the hello world app, fail ..... I tried to create an new app -- I got a message about cannot find a file "release".


Quote
Messages
Verbose: Selected chip architecture: armeabi-v7a
Verbose: Taking libraries from folder: C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\libs\armeabi-v7a
Project: Executing command before: Success
before build...
Compile Project, OS: android, CPU: arm, Target: C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\libs\armeabi-v7a\libcontrols.so: Exit code 1, Errors: 1, Hints: 2
Hint: Start of reading config file C:\lazarusAndroid\LAMW\lazarus\fpc\bin\x86_64-win64\fpc.cfg
Hint: End of reading config file C:\lazarusAndroid\LAMW\lazarus\fpc\bin\x86_64-win64\fpc.cfg
Verbose: Free Pascal Compiler version 3.2.2-r0d122c49 [2024/11/01] for arm
Verbose: Copyright (c) 1993-2021 by Florian Klaempfl and others
Verbose: Target OS: Android for ARMEL
Verbose: Compiling controls.lpr
Verbose: Compiling unit1.pas
unit1.pas(22,29) Verbose: Parameter "Sender" not used
Verbose: Assembling unit1
unit1.pas(42,0) Error: Assembler arm-linux-androideabi-as.exe not found, switching to external assembling
unit1.pas(42,0) Verbose: There were 1 errors compiling module, stopping
Verbose: Compilation aborted
Verbose: C:\lazarusAndroid\LAMW\lazarus\fpc\bin\x86_64-win64\ppcrossarm.exe returned an error exitcode


Could some kind soul zip up a folder with working iazarus, android SDKs etc and a working demo app and put it on github ?? I am sure the testers would have produced lots of these and it would not be a big deal.
I just want to evaluate it, not interested in bells and whistles.

petex

  • Jr. Member
  • **
  • Posts: 81
Re: LAMW Install not working
« Reply #6 on: November 01, 2024, 05:22:19 pm »
Changed path in project options to this and it compiled... Now looking for the APK

Quote
-FDC:\lazarusAndroid\LAMW\sdk\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin

dseligo

  • Hero Member
  • *****
  • Posts: 1419
Re: LAMW Install not working
« Reply #7 on: November 01, 2024, 05:46:57 pm »
Now looking for the APK

What do you mean by that?
What errors do you get when you go to menu Run, [LAMW] Build Android Apk and Run (or press Ctrl+F1)?

petex

  • Jr. Member
  • **
  • Posts: 81
Re: LAMW Install not working
« Reply #8 on: November 01, 2024, 06:08:59 pm »
Had to set win environment variable JAVA_HOME to C:\lazarusAndroid\LAMW\jdk\zulu-default

clicked on:
 Run // [LAMW] Build Android APK and run

Got this error :

Quote

Project: Executing command after: Success
after build...
Building APK (Gradle)... : FAILURE: Build failed with an exception., Errors: 1
None: Initialized native services in: C:\Users\peter\.gradle\native
None: Initialized jansi services in: C:\Users\peter\.gradle\native
None: Welcome to Gradle 8.2.1!
None: Here are the highlights of this release:
None:  - Kotlin DSL: new reference documentation, assignment syntax by default
None:  - Kotlin DSL is now the default with Gradle init
None:  - Improved suggestions to resolve errors in console output
None:  - Reduced sync memory consumption
None: For more details see https://docs.gradle.org/8.2.1/release-notes.html
None: Received JVM installation metadata from 'C:\lazarusAndroid\LAMW\jdk\zulu-default': {JAVA_HOME=C:\lazarusAndroid\LAMW\jdk\zulu-default, JAVA_VERSION=21.0.5, JAVA_VENDOR=Azul Systems, Inc., RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=21.0.5+11-LTS, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=21.0.5+11-LTS, VM_VENDOR=Azul Systems, Inc., OS_ARCH=amd64}
Fatal: FAILURE: Build failed with an exception.
* What went wrong:
Value 'C:\lazarusAndroid\' given for org.gradle.java.home Gradle property is invalid (Java home supplied seems to be invalid)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Exception, Errors: 1
Fatal: [Exception] Failed: Cannot build APK!


petex

  • Jr. Member
  • **
  • Posts: 81
Re: LAMW Install not working
« Reply #9 on: November 01, 2024, 06:28:59 pm »
In "gradle.properties" in the hello app folder
changed..... Note the double slash

Quote
org.gradle.java.home=C:\\lazarusAndroid\\LAMW\\jdk\\zulu-default

build progresses further ....

Quote

Messages, Hints: 2
Verbose: Selected chip architecture: armeabi-v7a
Verbose: Taking libraries from folder: C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\libs\armeabi-v7a
Verbose: Found library: libcontrols.so
Note: Duplicate unit "controls" in "controls", orphaned ppu "C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\obj\controls\controls.o"
Note: Duplicate unit "controls" in "LCLBase 3.4", ppu="C:\lazarusAndroid\LAMW\lazarus\lazarus\lcl\units\arm-android\controls.ppu", source="C:\lazarusAndroid\LAMW\lazarus\lazarus\lcl\controls.pp"
Project: Executing command before: Success
before build...
Compile Project, OS: android, CPU: arm, Target: C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\libs\armeabi-v7a\libcontrols.so: Success, Hints: 2
Hint: Start of reading config file C:\lazarusAndroid\LAMW\lazarus\fpc\bin\x86_64-win64\fpc.cfg
Hint: End of reading config file C:\lazarusAndroid\LAMW\lazarus\fpc\bin\x86_64-win64\fpc.cfg
Verbose: Free Pascal Compiler version 3.2.2-r0d122c49 [2024/11/01] for arm
Verbose: Copyright (c) 1993-2021 by Florian Klaempfl and others
Verbose: Target OS: Android for ARMEL
Verbose: Compiling controls.lpr
controls.lpr(10,31) Verbose: Unit "And_jni_Bridge" not used in controls
Verbose: Assembling controls
Verbose: Compiling resource C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\obj\controls\controls.or
Verbose: Linking C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\libs\armeabi-v7a\libcontrols.so
Verbose: 752 lines compiled, 0.9 sec
Verbose: 5 hint(s) issued
Project: Executing command after: Success
after build...
Building APK (Gradle)... : FAILURE: Build failed with an exception., Errors: 1
None: Initialized native services in: C:\Users\peter\.gradle\native
None: Initialized jansi services in: C:\Users\peter\.gradle\native
None: Received JVM installation metadata from 'C:\lazarusAndroid\LAMW\jdk\zulu-default': {JAVA_HOME=C:\lazarusAndroid\LAMW\jdk\zulu-default, JAVA_VERSION=21.0.5, JAVA_VENDOR=Azul Systems, Inc., RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=21.0.5+11-LTS, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=21.0.5+11-LTS, VM_VENDOR=Azul Systems, Inc., OS_ARCH=amd64}
None: Removing 0 daemon stop events from registry
None: Starting a Gradle Daemon (subsequent builds will be faster)
None: Starting process 'Gradle build daemon'. Working directory: C:\Users\peter\.gradle\daemon\8.2.1 Command: C:\lazarusAndroid\LAMW\jdk\zulu-default\bin\java.exe --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country=GB -Duser.language=en -Duser.variant -cp C:\lazarusAndroid\LAMW\lazarus\ccr\lamw-gradle\gradle-8.2.1\lib\gradle-launcher-8.2.1.jar -javaagent:C:\lazarusAndroid\LAMW\lazarus\ccr\lamw-gradle\gradle-8.2.1\lib\agents\gradle-instrumentation-agent-8.2.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.2.1
None: Successfully started process 'Gradle build daemon'
None: An attempt to start the daemon took 2.719 secs.
None: The client will now receive all logging from the daemon (pid: 1200). The daemon log file: C:\Users\peter\.gradle\daemon\8.2.1\daemon-1200.out.log
None: Starting build in new daemon [memory: 512 MiB]
None: Using 4 worker leases.
None: Received JVM installation metadata from 'C:\lazarusAndroid\LAMW\jdk\zulu-default': {JAVA_HOME=C:\lazarusAndroid\LAMW\jdk\zulu-default, JAVA_VERSION=21.0.5, JAVA_VENDOR=Azul Systems, Inc., RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=21.0.5+11-LTS, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=21.0.5+11-LTS, VM_VENDOR=Azul Systems, Inc., OS_ARCH=amd64}
None: Watching the file system is configured to be enabled if available
None: Now considering [C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord] as hierarchies to watch
None: File system watching is active
None: Starting Build
None: Settings evaluated using settings file 'C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\settings.gradle'.
None: Projects loaded. Root project using build file 'C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\build.gradle'.
None: Included projects: [root project 'AppHelloWord']
None: > Configure project :
None: Evaluating root project 'AppHelloWord' using build file 'C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\build.gradle'.
None: Compiling build file 'C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\build.gradle' using SubsetScriptTransformer.
None: The configuration :classpath is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
None: The configuration :classpath is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
None: The configuration :classpath is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
None: The configuration :classpath is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
None: Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/8.2.0/gradle-8.2.0.pom]
None: Downloading https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.2.0/gradle-8.2.0.pom to C:\Users\peter\.gradle\.tmp\gradle_download12746404658510423950bin
None: Downloading https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.2.0/gradle-8.2.0.module to C:\Users\peter\.gradle\.tmp\gradle_download11523828936445369375bin
None: Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/com/android/tools/sdk-common/31.2.0/sdk-common-31.2.0.pom]
None: Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/com/android/tools/build/gradle-settings-api/8.2.0/gradle-settings-api-8.2.0.pom]
None: Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/com/android/tools/repository/31.2.0/repository-31.2.0.pom]
None: Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/com/android/tools/sdklib/31.2.0/sdklib-31.2.0.pom]
None: Downloading https://dl.google.com/dl/android/maven2/com/android/tools/sdk-common/31.2.0/sdk-common-31.2.0.pom to C:\Users\peter\.gradle\.tmp\gradle_download9270702401293870811bin
None: Downloading https://dl.google.com/dl/android/maven2/com/android/tools/repository/31.2.0/repository-31.2.0.pom to C:\Users\peter\.gradle\.tmp\gradle_download7943968995994118112bin
None: Downloading https://dl.google.com/dl/android/maven2/com/android/tools/sdklib/31.2.0/sdklib-31.2.0.pom to C:\Users\peter\.gradle\.tmp\gradle_download4620262919013853829bin
None: Downloading https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle-settings-api/8.2.0/gradle-settings-api-8.2.0.pom to C:\Users\peter\.gradle\.tmp\gradle_download6966825547025383596bin
None: Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/com/android/tools/ddms/ddmlib/31.2.0/ddmlib-31.2.0.pom]
None:


etc . etc . etc
 Downloading https://repo.maven.apache.org/maven2/io/netty/netty-resolver/4.1.72.Final/netty-resolver-4.1.72.Final.jar to C:\Users\peter\.gradle\.tmp\gradle_download15000783123375567198bin
None: Downloading https://repo.maven.apache.org/maven2/io/netty/netty-tcnative-classes/2.0.46.Final/netty-tcnative-classes-2.0.46.Final.jar to C:\Users\peter\.gradle\.tmp\gradle_download10479518768947496345bin
None: Downloading https://repo.maven.apache.org/maven2/io/netty/netty-common/4.1.72.Final/netty-common-4.1.72.Final.jar to C:\Users\peter\.gradle\.tmp\gradle_download2407025487961799129bin
None: Compiling build file 'C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\build.gradle' using BuildScriptTransformer.
None: Using default execution profile
Fatal: FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'AppHelloWord'.
> Could not create an instance of type com.android.build.api.variant.impl.ApplicationVariantBuilderImpl.
   > Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
     If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 41s
Watched directory hierarchies: []
Exception, Errors: 1
Fatal: [Exception] Failed: Cannot build APK!


pure gobbledygook to me!!
« Last Edit: November 01, 2024, 06:32:36 pm by petex »

dseligo

  • Hero Member
  • *****
  • Posts: 1419
Re: LAMW Install not working
« Reply #10 on: November 01, 2024, 08:41:10 pm »
Open file build.gradle which is in C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\ (that is where demo project is).
Check if there is a line that contains namespace, like this line highlighted:
Code: Text  [Select][+][-]
  1. android {
  2.     namespace "org.lamw.apphelloword"
  3.     splits {
  4.         abi {
  5.             enable true
  6.  

I never opened this demo until this evening and there wasn't line with namespace either, but when I opened this demo, Lazarus asked me to update build.gradle (and I let him), and after that this file was changed.

I am attaching my build.gradle from this demo project, so you can compare it with your file.

P.S.: I had to add '.txt' extension on attached file because forum didn't allow me to post original name.

petex

  • Jr. Member
  • **
  • Posts: 81
Re: LAMW Install not working
« Reply #11 on: November 01, 2024, 08:59:01 pm »
hi,
i had just done that independently !!! thanks
Has built apk ---

 C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\build\outputs\apk\debug\AppHelloWord-armeabi-v7a-debug.apk

now to run it !!!! ha more fun and games


"Lazarus asked me to update build.gradle (and I let him)" - that didn't happen to me
« Last Edit: November 01, 2024, 09:02:24 pm by petex »

dseligo

  • Hero Member
  • *****
  • Posts: 1419
Re: LAMW Install not working
« Reply #12 on: November 01, 2024, 09:08:29 pm »
hi,
i had just done that independently !!! thanks
Has built apk ---

 C:\lazarusAndroid\LAMW\lazandroidmodulewizard\demos\GUI\AppHelloWord\build\outputs\apk\debug\AppHelloWord-armeabi-v7a-debug.apk

now to run it !!!! ha more fun and games

Great, I'm glad you did it. :)

petex

  • Jr. Member
  • **
  • Posts: 81
Re: LAMW Install not working
« Reply #13 on: November 02, 2024, 12:16:49 pm »
Can confirm app works on my phone. Thanks for assistance.

Can anyone explain the diff between using ant and gradle to build apk. As far as i can see, gradle requires to be online.

nobody.00

  • New Member
  • *
  • Posts: 14
Re: LAMW Install not working
« Reply #14 on: November 06, 2024, 01:27:41 pm »
Maybe you get old version of lamw_manager, this problem about of linkage of ndk lib has been fixed since v0.3.1.8

Get latest version in https://github.com/dosza/LAMWManager-win/releases/tag/v0.3.1.8

 

TinyPortal © 2005-2018