Recent

Author Topic: Error compiling example project in LAMW  (Read 1122 times)

Lazarinr

  • New member
  • *
  • Posts: 9
Error compiling example project in LAMW
« on: August 11, 2025, 06:05:41 am »
When I create a new project in LAMW, it compiles normally without errors. However, when I compile a project from the demo folder, this error occurs.

Code: Pascal  [Select][+][-]
  1. Messages
  2. Verbose: Selected chip architecture: armeabi
  3. Verbose: Taking libraries from folder: C:\lamw_manager\LAMW\lazandroidmodulewizard\demos\GUI\AppClockDemo1\libs\armeabi
  4. Project: Executing command before: Success
  5. before build...
  6. Compile Project, OS: android, CPU: arm, Target: C:\lamw_manager\LAMW\lazandroidmodulewizard\demos\GUI\AppClockDemo1\libs\armeabi\libcontrols.so: Exit code 1, Errors: 1
  7. 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:\lamw_manager\LAMW\LAMW4Windows\fpc\3.2.0\units\arm-android\rtl\system.ppu..
  8. Exception, Errors: 1
  9. Fatal: [Exception] Failed: Cannot build project
  10.  

nicelybrewed

  • New Member
  • *
  • Posts: 26
Re: Error compiling example project in LAMW
« Reply #1 on: August 11, 2025, 08:04:16 am »
Check that the project is set to the correct chipset to match your device, it looks like it's set to ARMv6, most likely needs to be Aaarch64 or ARMv7a+VFPv3 depending on your device, in Project Options > [LAMW] Android Project Options > Build.
Lazarus v3.8, LAMW v0.8.6.4-blue, NDK v22b, Android 15, Windows 11 mainly but also use LAMW on Linux.

Lazarinr

  • New member
  • *
  • Posts: 9
Re: Error compiling example project in LAMW
« Reply #2 on: August 11, 2025, 01:53:01 pm »
Thanks for your help, @nicelybrewed.

I did as you suggested and it fixed the error, but now it displays another error.

Code: Pascal  [Select][+][-]
  1. Messages, Hints: 2
  2. Verbose: Selected chip architecture: armeabi
  3. Verbose: Taking libraries from folder: C:\lamw_manager\LAMW\lazandroidmodulewizard\demos\GUI\AppClockDemo1\libs\armeabi
  4. Note: Duplicate unit "controls" in "controls", orphaned ppu "C:\lamw_manager\LAMW\lazandroidmodulewizard\demos\GUI\AppClockDemo1\obj\controls\controls.o"
  5. Note: Duplicate unit "controls" in "LCLBase 3.8", ppu="C:\lamw_manager\LAMW\LAMW4Windows\lazarus_trunk\lcl\units\arm-android\controls.ppu", source="C:\lamw_manager\LAMW\LAMW4Windows\lazarus_trunk\lcl\controls.pp"
  6. Project: Executing command before: Success
  7. before build...
  8. Compile Project, OS: android, CPU: arm, Target: C:\lamw_manager\LAMW\lazandroidmodulewizard\demos\GUI\AppClockDemo1\libs\armeabi-v7a\libcontrols.so: Success
  9. Project: Executing command after: Success
  10. after build...
  11. Building APK (Gradle)... : FAILURE: Build failed with an exception., Errors: 1
  12. Fatal: FAILURE: Build failed with an exception.
  13. * What went wrong:
  14. Execution failed for task ':processDebugMainManifest'.
  15. > Manifest merger failed : android:exported needs to be explicitly specified for element <activity#com.example.appclockdemo1.App>. 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. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
  16. * Try:
  17. > Run with --stacktrace option to get the stack trace.
  18. > Run with --debug option to get more log output.
  19. > Run with --scan to get full insights.
  20. > Get more help at https://help.gradle.org.
  21. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
  22. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
  23. For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
  24. BUILD FAILED in 6s
  25. 15 actionable tasks: 15 executed
  26. Watched directory hierarchies: [C:\lamw_manager\LAMW\lazandroidmodulewizard\demos\GUI\AppClockDemo1]
  27. Exception, Errors: 1
  28. Fatal: [Exception] Failed: Cannot build APK!

nicelybrewed

  • New Member
  • *
  • Posts: 26
Re: Error compiling example project in LAMW
« Reply #3 on: August 11, 2025, 02:31:38 pm »
This is because the demos were created prior to Android 12, and LAMW I defaults to targeting a higher API than Android 12,  you could also reduce the 'Target SDK Version' to 30 (Android 11) for testing....or amend your demo, like below:

The Androidmanifest.xml file in the root of that demo needs adjusted slightly to include the android:exported option in the activity element like:

Code: Pascal  [Select][+][-]
  1.     <activity android:name="com.example.appclockdemo1.App" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden|screenSize|screenLayout|fontScale" android:exported="true">

Notice android:exported="true" has been added to the end of this line,

It should compile/run after that change, you may find other demos are the same.
Lazarus v3.8, LAMW v0.8.6.4-blue, NDK v22b, Android 15, Windows 11 mainly but also use LAMW on Linux.

Lazarinr

  • New member
  • *
  • Posts: 9
Re: Error compiling example project in LAMW
« Reply #4 on: August 11, 2025, 03:01:51 pm »
Solved!

Thanks for the contribution @nicelybrewed.

nicelybrewed

  • New Member
  • *
  • Posts: 26
Re: Error compiling example project in LAMW
« Reply #5 on: August 11, 2025, 03:05:12 pm »
 8-)

No worries.
« Last Edit: August 11, 2025, 03:12:00 pm by nicelybrewed »
Lazarus v3.8, LAMW v0.8.6.4-blue, NDK v22b, Android 15, Windows 11 mainly but also use LAMW on Linux.

 

TinyPortal © 2005-2018