Recent

Author Topic: [LAMW] Error compiling and running app on Android Emulator  (Read 1467 times)

Lazarinr

  • New member
  • *
  • Posts: 9
[LAMW] Error compiling and running app on Android Emulator
« on: August 30, 2025, 11:08:09 pm »
I created a small test project in LAMW, which compiled and ran normally on my phone. However, when I disconnect the phone from the USB port and try to run it on the Android Emulator, I get the error below. Do I need to configure anything in the project option?

Code: Pascal  [Select][+][-]
  1. Messages, Hints: 2
  2. Verbose: Selected chip architecture: armeabi-v7a
  3. Verbose: Taking libraries from folder: C:\Users\USER\Dev\LAMWProjects\AppLAMWProject1\libs\armeabi-v7a
  4. Verbose: Found library: libcontrols.so
  5. Note: Duplicate unit "controls" in "controls", orphaned ppu "C:\Users\USER\Dev\LAMWProjects\AppLAMWProject1\obj\controls\controls.o"
  6. 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"
  7. Project: Executing command before: Success
  8. before build...
  9. Compile Project, OS: android, CPU: arm, Target: C:\Users\USER\Dev\LAMWProjects\AppLAMWProject1\libs\armeabi-v7a\libcontrols.so: Success
  10. Project: Executing command after: Success
  11. after build...
  12. Building APK (Gradle)... : Success
  13. Starting APK (Gradle)... : FAILURE: Build failed with an exception., Errors: 1
  14. Fatal: FAILURE: Build failed with an exception.
  15. * What went wrong:
  16. Execution failed for task ':installDebug'.
  17. > java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to install on any devices.
  18. * Try:
  19. > Run with --stacktrace option to get the stack trace.
  20. > Run with --info or --debug option to get more log output.
  21. > Run with --scan to get full insights.
  22. > Get more help at https://help.gradle.org.
  23. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
  24. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
  25. 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.
  26. BUILD FAILED in 3s
  27. 34 actionable tasks: 1 executed, 33 up-to-date
  28. Exception, Errors: 1
  29. Fatal: [Exception] Failed: Cannot run APK!
  30.  
« Last Edit: August 30, 2025, 11:09:57 pm by Lazarinr »

nobody.00

  • New Member
  • *
  • Posts: 25
Re: [LAMW] Error compiling and running app on Android Emulator
« Reply #1 on: August 31, 2025, 12:54:27 am »
Your emulator probably is not arm,

Lazarinr

  • New member
  • *
  • Posts: 9
Re: [LAMW] Error compiling and running app on Android Emulator
« Reply #2 on: August 31, 2025, 02:25:52 am »
I installed Android Studio's Virtual Device Manager and created a device with these settings:


DEVICE
OEM = Generic
Supported API = 24+
Levels

SYSTEM IMAGE
API Level = 36
Services = Google Play
ABI = x86_64
Translated ABI = arm64-v8a

Screen
Resolution = 1080 x 2400
Density = 400 dpi

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1290
Re: [LAMW] Error compiling and running app on Android Emulator
« Reply #3 on: August 31, 2025, 09:46:21 am »
Hello,
🔹 What is ABI in Android Virtual Devices?

ABI (Application Binary Interface) defines how your compiled code interacts with the system at the binary level. It depends on:

The CPU architecture (e.g., ARM, x86, x86_64)

The calling convention

Register usage, alignment, etc.

🔹 Common ABIs in Android:
ABI   CPU Architecture   Emulator Support
armeabi-v7a   32-bit ARM   Translated (emulated on x86)
arm64-v8a   64-bit ARM   Translated (emulated on x86_64)
x86   32-bit Intel   Native (best emulator perf)
x86_64   64-bit Intel   Native (best emulator perf)
🔹 Translated ABI in Emulator:

A translated ABI is used when the system image ABI doesn’t match the host CPU ABI, so the emulator must emulate the CPU.

Example:

You install an ARM64 system image on an x86_64 host machine.

The emulator uses Houdini (a binary translator from Google) to translate ARM binaries to x86 instructions.

This makes it possible to run ARM apps on an x86 machine but is slower than running a native x86 system image.

🔹 Choosing a System Image for AVD:

If performance matters → choose x86 or x86_64 system images.

If you're testing ARM-only apps or need exact hardware simulation → use ARM images (with translation if needed).

🔹 How to Check ABI in Emulator:

You can check your emulator's ABI with:

adb shell getprop ro.product.cpu.abi


Or check the AVD config file (~/.android/avd/<your_avd>.avd/config.ini):

abi.type=x86_64

Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

tetrastes

  • Hero Member
  • *****
  • Posts: 766
Re: [LAMW] Error compiling and running app on Android Emulator
« Reply #4 on: August 31, 2025, 11:38:27 am »
Code: Pascal  [Select][+][-]
  1. Verbose: Selected chip architecture: armeabi-v7a

Translated ABI = arm64-v8a

Lazarinr

  • New member
  • *
  • Posts: 9
Re: [LAMW] Error compiling and running app on Android Emulator
« Reply #5 on: August 31, 2025, 04:10:52 pm »
I changed the chipset to Aarch64 and it solved the problem.

Thanks for your help.
« Last Edit: September 01, 2025, 01:32:34 am by Lazarinr »

 

TinyPortal © 2005-2018