Recent

Author Topic: [SOLVED] LAMW Android Virtual Device (AVD)  (Read 1632 times)

iru

  • Full Member
  • ***
  • Posts: 248
[SOLVED] LAMW Android Virtual Device (AVD)
« on: September 26, 2020, 02:49:44 am »
Gentlefolk,

I need some help with using LAMW.

My environment is Linux mint 20 on a Lenovo x230 8GB memory.
LAWM version VERSION=0.3.5r1 (From the lamw-install.log).
 
In the LAZ IDE I can open a LAWM project and build/compile a module. Compiler reports success.

How do I 'RUN' this module?

In the IDE>Run> I presume I use '[LAMW] Build Android APK and run???
If I try this a small 'Android emulators' window is displayed - no AVDs defined.
Click on 'AVD manager' and the 'Android Virtual Device (AVD) manager window is displayed. No AVDs defined.
Click on 'Create' and a window 'Create new Android Virtual Device (AVD)' is displayed.

Here things stop on the 'CPU/ABI' as any combination of Device and Target does not result in any 'system image'.

Am I working in the correct direction? What have I missed???

Any help appreciated, Ian.
« Last Edit: October 08, 2020, 06:32:17 am by iru »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW Android Virtual Device (AVD)
« Reply #1 on: September 26, 2020, 03:51:58 am »
Yes, you are in correct direction...

Quote
I presume I use '[LAMW] Build Android APK and run???

Yes,  but you can try first use "Run" --> "Build" to produce a pure pascal compilation..
[and debug/fix your pascal code ...]

then

 '[LAMW] Build Android APK and run 

to produce an "apk"  and install in your cell phone (real or virtual/avd)....

but your need:

1)  To install in a real phone you need some  "developer" permission
[please,  look for in google some tutorial about ....]

2) To install in virtual device (avd)  you first need create it!
[please,  look for in google some tutorial about  how to create an avd....]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

iru

  • Full Member
  • ***
  • Posts: 248
Re: LAMW Android Virtual Device (AVD)
« Reply #2 on: September 26, 2020, 09:48:05 am »
Thank you for the rapid response.

I am now grinding my way through the installation of android-studio and the construction of AVDs. A slow mind numbing process.Currently have a phone running in an emulator.  Still struggling with device types and CPU/ABI...

Woops, had the emulator running and in the IDE clicked Run>LAMW Build Android APk (to refresh my memory on something)  and slowly my small application appeared in the emulator.

Minor miracle, I battle on!

Thanks once again, Ian

shyub

  • New Member
  • *
  • Posts: 25
Re: [Solved] LAMW Android Virtual Device (AVD)
« Reply #3 on: September 29, 2020, 09:43:18 pm »
I started using LAMW quite recently. But to check that the project works, I use Genymotion with a Free license. This emulator is significantly faster than AVD. True, there are difficulties with its installation (on a laptop with a weak video card I managed to install only genymotion-2.9.0, on a stationary computer I have genymotion-3.1.0 installed. The latest version of genymotion-3.1.1 could not be installed).
Before debugging the project, you should start Genymotion, in which case the project will be launched automatically in the debugger.
Also, after creating a virtual device in Genymotion, do not forget to connect the Genymotion-ARM-Translation ... package corresponding to the Android version, which can be downloaded from https://github.com/m9rco/Genymotion_ARM_Translation, as well as on the official website.

iru

  • Full Member
  • ***
  • Posts: 248
Re: [Not-Solved] LAMW Android Virtual Device (AVD)
« Reply #4 on: October 03, 2020, 01:40:53 pm »
Gentlefolk,

Things went down rapidly down hill when I got into the 'android' world, things like Gradle, Groovy, Maven, SDKs, NDKs take some getting ones head around.

I shut down the PC and when I started up things in the environment such as PATHS must have been lost and all sorts of things did not make sense.

So after thinking about it I cleaned everything out and started again following the HOWTO in https://forum.lazarus.freepascal.org/index.php/topic,40750.0.html

Worked my through it step by step and thing looked good until I got to the #2 information of Wayne Sherman at the following line: 'From a command line run "gradle-local-build.sh" from the project folder.

This generated some 600 lines of data and failed with the following:

Task ':compileDebugJavaWithJavac' is not up-to-date because:
  No history is available.
All input files are considered out-of-date for incremental task ':compileDebugJavaWithJavac'.
Compiling with source level 1.7 and target level 1.7.
Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments.
file or directory '/home/iru/Laz/projects/and1/AppLAMWProject1/build-types/debug/java', not found <<<<< 'build-type' does not exist
file or directory '/home/iru/Laz/projects/and1/AppLAMWProject1/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out', not found <<<<< 'aidl_source_output_dir' does not exist
Compiling with JDK Java compiler API.

/home/iru/Laz/projects/and1/AppLAMWProject1/src/org/lamw/applamwproject1/Controls.java:1593: error: cannot find symbol
                        controls.activity.setTurnScreenOn(_value);

I am having a lot of trouble with size, complexity and confusion of the android environment, it is difficult to troubleshoot while learning.

Any solutions/suggestions/ideas/etc??? help, Ian

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: [Solved] LAMW Android Virtual Device (AVD)
« Reply #5 on: October 03, 2020, 08:30:49 pm »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

iru

  • Full Member
  • ***
  • Posts: 248
Re: [Solved] LAMW Android Virtual Device (AVD)
« Reply #6 on: October 04, 2020, 10:56:01 am »
Thank you for your response.

I followed the https://github.com/DanielOliveiraSouza/LAMW4Linux-installer path.

Clean build of Mint-20, every update applied.

The LAWM install process ran to completion, no errors. IDE runs and looks good.

Followed the 'UserGuideSample.PDF' to create a new project.

All good until page 21.  [LAMW] Android APK....

Here we go again.... A form 'Android emulators', no AVDs listed!
Tried the AVD form 'Create.....'
Cant create a device because the target is 'Android 9 API  level 28'  (only choice) and there is NO CPU/ABI installed for this target.

Once again I grind to a halt in the mysterious underworld of android.......

So why no 'Gradle' compile?? Why look for an emulator???

Ian

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: [Solved] LAMW Android Virtual Device (AVD)
« Reply #7 on: October 04, 2020, 05:50:31 pm »

Quote
Why look for an emulator???

Please, try real device!!!

but remember: To install in a real phone you need some  "developer" permission
[please,  look for in google some tutorial about  your device model....]

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

iru

  • Full Member
  • ***
  • Posts: 248
Re: [Solved] LAMW Android Virtual Device (AVD)
« Reply #8 on: October 04, 2020, 11:13:12 pm »
From page 20-21of the 'UserGuideSample.pdf'

Run>Build - performs a clean error free compile.

Run> [LAMW] Build Android APK and Run - a very quick flash of a 'terminal' window across the screen and then the 'emulator' form.
Nothing like what is shown in the UserSampleGuide on page 22.

Click on the Cancel on the 'emulator' form and nothing further happens. No sign of the 'Gradle' daemon/compile shown on pages 22, etc.

It appears that Gradle daemon/compile is failing!

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: [NOT Solved] LAMW Android Virtual Device (AVD)
« Reply #9 on: October 05, 2020, 02:58:45 am »

Quote
It appears that Gradle daemon/compile is failing!

Gradle try "javac" to compile java code and then if all is ok try make an apk and install in real device or AVD..

Quote
It appears that Gradle daemon/compile is failing!

What about LAMW.ini file?

Maybe you need fix some config path...
« Last Edit: October 05, 2020, 03:05:13 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

iru

  • Full Member
  • ***
  • Posts: 248
Re: [NOT Solved] LAMW Android Virtual Device (AVD)
« Reply #10 on: October 05, 2020, 12:45:32 pm »
LAMW.ini file???

A search of the entire file system for LAMW.ini reveals NO LAMW.ini file!!!

A search of the 'LAMW' directory where all LAMW is installed shows 44 other .ini files.

Where should the LAMW.ini be located in the LAMW directory structure???

It looks like somethings did not get built.

Ian


jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: [NOT Solved] LAMW Android Virtual Device (AVD)
« Reply #11 on: October 05, 2020, 08:34:45 pm »
Quote
Where should the LAMW.ini be located in the LAMW directory structure???

No. Look for it in folder Lazarus/config
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

iru

  • Full Member
  • ***
  • Posts: 248
Re: [NOT Solved] LAMW Android Virtual Device (AVD)
« Reply #12 on: October 06, 2020, 01:33:38 am »
No sign of LAMW.ini anywhere.

I did find ~/LAMW/lamw4linux/lamw-install.log (contents below, all paths are correct).

A cold grey day here, I have some work outside so I will commence a rebuild and see what happens....

Ian.

Generate LAMW_INSTALL_VERSION=0.3.5r1
Info:
LAMW4Linux:/home/iru/LAMW/lamw4linux
LAMW workspace:/home/iru/Dev/LAMWProjects
Android SDK:/home/iru/LAMW/sdk
Android NDK:/home/iru/LAMW/ndk
Gradle:/home/iru/LAMW/gradle-6.1.1
OLD_ANDROID_SDK=1
ANT_VERSION=1.10.8
GRADLE_VERSION=6.1.1
SDK_TOOLS_VERSION=r25.2.5
NDK_VERSION=r21d
FPC_VERSION=3.2.0
LAZARUS_VERSION=2.0.10
AARCH64_SUPPORT=1
Install-date:Sun 04 Oct 2020 17:08:54 AEDT

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: [NOT Solved] LAMW Android Virtual Device (AVD)
« Reply #13 on: October 06, 2020, 02:07:59 am »

You can try fix some LAMW path in  Lazarus IDE:

"Tools"  --> "[LAMW] ...." -->  "Paths Settings ..."
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

iru

  • Full Member
  • ***
  • Posts: 248
Re: [NOT Solved] LAMW Android Virtual Device (AVD)
« Reply #14 on: October 06, 2020, 09:04:58 am »
Partial success!

A clean build of Linux Mint 20, all updates applied.

Automatic install of LAMW.

Started Laz, looks good, perform Run>Build, no errors, perform Run> LAMW Build android APK & Run, FAILS.
Same as previous build, in 'messages' 'Gradle successful', terminal session, then the form about the emulator....

I had piped the build process to a file, scanned it looking for error indications or things that looked odd, nothing I considered significant
In the IDE Tools>LAMW Android Module Wizard>Paths/Settings and reviewed each file path. The last one (Path to Android SDK) is the problem

With the default of /home/iru/LAMW/sdk the ERROR OCCURS.

Change it to anything like /home/iru/LAMW/sdk/xxx and the terminal session opens and Gradle process commences.
It fails after some time and the error in the IDE message area is a complaint that 'Executable not found: /home/iru/LAMW/sdk/xxx/platform-tools/adb'.

I presume it is looking for the ADB executable in ~/LAMW/sdk/platform-tools.

Things are not simple: Use ~/LAMW/sdk/platform-tools and you get an error ~/LAMW/sdk/platform-tools/platform-tools/adb not found.
Looks like a bug, some more help please, Ian.


At the default path
 

 

TinyPortal © 2005-2018