Recent

Author Topic: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)  (Read 31865 times)

WayneSherman

  • Full Member
  • ***
  • Posts: 119
Updated 2021-Oct-21 ver 1.6
(for changes see here)

See also:  http://wiki.freepascal.org/LAMW_on_Linux

Motivation:
  Needed simple instructions to get an up-to-date Android build environment setup on Linux.
   
Thanks to other developers for sharing their hard work, utilities, and helpful information.
Please provide feedback if you find any issues, or if there are ways to simplify even more.

Everything is self-contained under the user's home "android" folder
$HOME/android/sdk  (android sdk and build tools)
$HOME/android/sdk/ndk-bundle  (android ndk)
$HOME/android/fpcupdeluxe_app  (FPCUPdeluxe installer)
$HOME/android/projects  (default LAMW projects folder)
$HOME/android/fpc-lazarus  (FPC, Lazarus built w/ LAMW)
$HOME/android/fpc-lazarus/ccr/lamw  (LAMW files and demos)
$HOME/android/fpc-lazarus/ccr/lamw-gradle  (gradle build tool)

Versions Tested
Xubuntu 20.04 64-bit w/ latest updates installed

Android Command-Line Tools for Linux build 7583922
OpenJDK 11
Android SDK/API Level 29 (Android 10)
Android NDK revision 22
Gradle 6.8.3 (installed automatically by FPCUPdeluxe)

FPCUPdeluxe ver 2.2.0c
FPC stable v3.2.2
Lazarus stable v2.0.12

32-bit CPU Target: ARMv7a + VFPv3 (hardware floating point)
64-bit CPU Target: Aarch64

I recommend running these commands one at a time so you can verify the results before moving on to the next step.

Code: Bash  [Select][+][-]
  1. # Setup Android Development Environment on Linux (FPCUPdeluxe / LAMW)
  2. # Tested on Xubuntu 20.04 64-bit
  3. # Targets: 32-bit ARM and 64-bit aarch64
  4. # 2021-Oct-21 ver 1.6
  5.  
  6. # Install libraries and tools
  7. sudo apt install -y libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev libxtst-dev libatk1.0-dev libghc-x11-dev freeglut3 freeglut3-dev
  8. sudo apt install -y git subversion make build-essential gdb zip unzip unrar wget
  9. sudo apt install -y openjdk-11-jdk android-tools-adb
  10.  
  11. # download and extract Android SDK Command Line Tools for Linux
  12. # from https://developer.android.com/studio/#downloads
  13. mkdir -p "$HOME/android/sdk/cmdline-tools"
  14. cd "$HOME/android/sdk/cmdline-tools"
  15. wget "https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip"
  16. unzip "commandlinetools-linux-7583922_latest.zip"
  17. rm "commandlinetools-linux-7583922_latest.zip"
  18. mv cmdline-tools tools
  19.    
  20. # Install SDK packages and NDK (as of 2021-Oct-21 this pulls in NDK r22b)
  21. cd "$HOME/android/sdk/cmdline-tools/tools/bin"
  22. yes | ./sdkmanager --licenses
  23. ./sdkmanager "platforms;android-29" "build-tools;29.0.3" "tools" "ndk-bundle" "extras;android;m2repository"
  24.  
  25. # Download FPCUPdeluxe from https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/latest
  26. # (tested with version 2.2.0c)
  27. mkdir "$HOME/android/fpcupdeluxe_app"
  28. cd "$HOME/android/fpcupdeluxe_app"
  29. wget "https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v2.2.0c/fpcupdeluxe-x86_64-linux"
  30. chmod +x fpcupdeluxe-x86_64-linux
  31. echo "[General]" > fpcupdeluxe.ini
  32. echo "InstallDirectory=$HOME/android/fpc-lazarus" >> fpcupdeluxe.ini
  33. ./fpcupdeluxe-x86_64-linux
  34.  
  35. # Using the FPCUPdeluxe GUI
  36. # (The install path is already set to: /home/[your_user]/android/fpc-lazarus)
  37. #
  38. # 1) At the bottom of the main Window, click "Android LAMW"
  39. #
  40. # As of 2021-Oct-21, this installs stable FPC (3.2.2), stable Lazarus (v2.0.12), cross
  41. # compilers for arm/android and aarch64/android, gradle v6.8.3, and latest LAMW from git.
  42. #
  43. # 2) (Optional) On module tab click the "OPM" button to install Online Package Manager.
  44. # 3) Close FPCUPdeluxe
  45.  
  46. # Make a better name for the desktop shortcut
  47. mv "$(xdg-user-dir DESKTOP)/fpcup-Lazarus_fpc-lazarus.desktop" "$(xdg-user-dir DESKTOP)/Lazarus-LAMW.desktop"
  48. sed -i "/^Name=/c\Name=Lazarus-LAMW" "$(xdg-user-dir DESKTOP)/Lazarus-LAMW.desktop"
  49.  
  50. # Create a directory for android projects
  51. mkdir -p "$HOME/android/projects"
  52.  
  53. # Edit LAMW settings via the ini file
  54. LAMWini="$HOME/android/fpc-lazarus/config_lazarus/LAMW.ini"
  55. sed -i "/PathToWorkspace/c\PathToWorkspace=$HOME/android/projects" $LAMWini
  56. echo "PathToAndroidNDK=$HOME/android/sdk/ndk-bundle" >> $LAMWini
  57. echo "PathToAndroidSDK=$HOME/android/sdk" >> $LAMWini
  58. echo "NDK=5" >> $LAMWini
  59. echo "PrebuildOSYS=linux-x86_64" >> $LAMWini
  60.  
  61. # After launching Lazarus-LAMW, you can confirm paths and settings in
  62. # the Tools | [LAMW] Android Module Wizard | Path Settings menu
  63.  
  64. # For new LAMW projects
  65. #  for 32-bit:  ARMv7a + VFPv3 for Architecture/Instructions
  66. #  for 64-bit:  Aarch64 for Architecture/Instructions
  67.  


Optional for command line work

Code: Bash  [Select][+][-]
  1. #Create shell script and desktop shortcut
  2.  
  3. LAMWini="$HOME/android/fpc-lazarus/config_lazarus/LAMW.ini"
  4. # Note: the following lines must be copy/pasted as one line, starting at "cat" and ending at "EOF"
  5. cat <<EOF > $HOME/android/set_dev_environment
  6. #!/bin/sh
  7. # Setup environment for fpc / lazarus / android command line work
  8.  
  9. FPC_PATH="$HOME/android/fpc-lazarus/fpc/bin/x86_64-linux"
  10. LAZ_PATH="$HOME/android/fpc-lazarus/lazarus"
  11.  
  12. export PPC_CONFIG_PATH=\${FPC_PATH}
  13. export PATH=\${FPC_PATH}:\${LAZ_PATH}:\${PATH}
  14.  
  15. export ANDROID_SDK_ROOT="${HOME}/android/sdk"
  16. export GRADLE_HOME="$(awk -F '=' '/PathToGradle/{print $NF}' $LAMWini)"
  17. export PATH=\${PATH}:\${GRADLE_HOME}/bin
  18.  
  19. cd "$HOME/android/projects"
  20. exec /bin/bash
  21. EOF
  22. chmod +x $HOME/android/set_dev_environment
  23.  
  24.  
  25. # 2021-Oct-18 - use $(xdg-user-dir DESKTOP) instead of hard-coded user Desktop path (thank you guaracy)
  26.  
  27. # Note: the following lines must be copy/pasted as one line, starting at "cat" and ending at "EOF"
  28. cat <<EOF > "$(xdg-user-dir DESKTOP)/Android-Command-Line.desktop"
  29. [Desktop Entry]
  30. Type=Application
  31. Icon=utilities-terminal
  32. Exec=$HOME/android/set_dev_environment
  33. Name=Android-Command-Line
  34. Terminal=true
  35. StartupNotify=false
  36. EOF
  37. chmod +x "$(xdg-user-dir DESKTOP)/Android-Command-Line.desktop"
  38.  
« Last Edit: October 22, 2021, 07:18:29 am by WayneSherman »

WayneSherman

  • Full Member
  • ***
  • Posts: 119
Re: Setup Android Development Environment on Linux (FPCUPdeluxe / LAMW)
« Reply #1 on: April 02, 2018, 10:37:21 pm »
RESERVED FOR FUTURE USE
« Last Edit: June 13, 2021, 12:17:11 am by WayneSherman »

WayneSherman

  • Full Member
  • ***
  • Posts: 119
Re: Setup Android Development Environment on Linux (FPCUPdeluxe / LAMW)
« Reply #2 on: April 02, 2018, 10:37:40 pm »
See first post (above) for new install procedure 2021-Jun-05 ver 1.5.

[OLDER / ARCHIVED INSTRUCTIONS BELOW]
2019-May-20 ver 1.3

Code: Text  [Select][+][-]
  1. # Setup Android Development Environment on Linux (FPCUPdeluxe / LAMW)
  2. # Tested on Xubuntu 16.04 64-bit and Xubuntu 18.04 64-bit
  3. # Target 32-bit ARM on Android
  4. # Target 64-bit aarch64 on Android
  5. # 2019-May-20 ver 1.3
  6.  
  7. # Install libraries and tools
  8. sudo apt-get install -y libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev libxtst-dev libatk1.0-dev libghc-x11-dev freeglut3 freeglut3-dev
  9. sudo apt-get install -y git subversion make build-essential gdb zip unzip unrar wget
  10. sudo apt-get install -y openjdk-8-jdk android-tools-adb ant
  11.  
  12. #Note:  Next line is not needed on Ubuntu 16.04
  13. sudo update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64
  14.  
  15. mkdir -p "$HOME/android/sdk"
  16.  
  17. # download and extract Android SDK Command Line Tools for Linux
  18. # from https://developer.android.com/studio/#downloads
  19. cd "$HOME/android/sdk"
  20. wget "https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
  21. unzip "sdk-tools-linux-4333796.zip"
  22. rm "sdk-tools-linux-4333796.zip"
  23.  
  24. #Install SDK packages and NDK (as of 2019-May-20 this pulls in NDK r19c)
  25. cd "$HOME/android/sdk/tools/bin"
  26. ./sdkmanager "platforms;android-26" "build-tools;26.0.3" "tools" "ndk-bundle" "extras;android;m2repository"
  27.  
  28. # make symbolic link to NDK toolchain
  29. ln -sf "$HOME/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin" "$HOME/android/ndk-toolchain"
  30.  
  31. # work around bug, NDK 18 removed MIPS toolchains, but gradle plugin 3.0.1 won't run unless they are present
  32. ln -sf "$HOME/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9" "$HOME/android/sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9"
  33. ln -sf "$HOME/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9" "$HOME/android/sdk/ndk-bundle/toolchains/mipsel-linux-android-4.9"
  34.  
  35. # download and extract Gradle 4.10.3
  36. # from https://gradle.org/releases/
  37. cd "$HOME/android"
  38. wget "https://services.gradle.org/distributions/gradle-4.10.3-bin.zip"
  39. unzip "gradle-4.10.3-bin.zip"
  40. rm "gradle-4.10.3-bin.zip"
  41.  
  42. # Use a text editor to open $HOME/.profile and add this text below:
  43. # example: mousepad $HOME/.profile
  44. export ANDROID_SDK_ROOT="${HOME}/android/sdk"
  45. export GRADLE_HOME="${HOME}/android/gradle-4.10.3"
  46. export PATH="${PATH}:${HOME}/android/ndk-toolchain"
  47. export PATH="${PATH}:${GRADLE_HOME}/bin"
  48.  
  49. # Reboot (or logout of session and login)
  50.  
  51. # Download FPCUPdeluxe from https://github.com/newpascal/fpcupdeluxe/releases/latest
  52. # (tested with version 1.6.2v)
  53. mkdir "$HOME/fpcupdeluxe_app"
  54. cd "$HOME/fpcupdeluxe_app"
  55. wget "https://github.com/newpascal/fpcupdeluxe/releases/download/1.6.2v/fpcupdeluxe-x86_64-linux"
  56. chmod +x fpcupdeluxe-x86_64-linux
  57. ./fpcupdeluxe-x86_64-linux
  58. # Using FPCUPdeluxe install FPC/Lazarus, crosscompiler, and packages/modules:
  59. # 1) On "Basic" tab, select FPC version "fixes3.2" & Lazarus version "fixes2.0" and click "Install/update FPC+Laz" button (if this fails, please see comments in next post)
  60. # 2) On "Cross" tab, select CPU arm & OS android, "Install compiler" (select "yes" to missing tools message box)
  61. # 3) On "Cross" tab, select CPU aarch64 & OS android, "Install compiler" (Ignore trunk warning, select "yes" to missing tools message box)
  62. # 4) On Modules tab, select LAMW, Install module
  63. # 5) (Optional but recommended) In module list: Select OPM, Install module (online package manager)
  64.  
  65. # Run Lazarus using the shortcut created by FPCUPdeluxe
  66.  
  67. # NOTE: DO NOT forget to replace references to [user] with your user name in 3 paths below
  68. # Select Tools menu > [Lamw] Android Module Wizard > Paths Settings: [Jdk, Sdk, Ndk, ...]:
  69. # Path to Java JDK: /usr/lib/jvm/java-8-openjdk-amd64
  70. # Path to Ant bin: /usr/bin
  71. # Path to Gradle: /home/[user]/android/gradle-4.10.3
  72. # Path to Android NDK: /home/[user]/android/sdk/ndk-bundle
  73. # NDK Version: >11
  74. # Your Desktop System: linux-x86_64
  75. # Path to Android SDK: /home/[user]/android/sdk
  76.  
  77. # For new LAMW projects, use Gradle for APK Builder and
  78. #  for 32-bit:  ARMv7a + VFPv3 for Architecture/Instructions
  79. #  for 64-bit:  Aarch64 for Architecture/Instructions
  80.  

Manjaro Linux (based on Arch Linux).
(Note: not tested since 2018-Apr-19)
Manjaro requires these changes:

1) Instead of apt-get, use pacman with these packages:
# Install libraries and tools
sudo pacman -S --needed libx11 gtk2 gdk-pixbuf2 cairo pango libxtst atk freeglut
sudo pacman -S --needed git subversion make gdb zip unzip unrar wget
sudo pacman -S --needed android-tools apache-ant jdk8-openjdk

2) #Install SDK packages and NDK using sdkmanager
In my test the NDK was not installing and sdkmanager gave an error "No space left on device".  By default /tmp is a tmpfs limited to half the size of your RAM, if your RAM size is small, you may have to temporarily unmount /tmp from tmpfs before installing sdk/ndk packages:
sudo umount -l /tmp
(remember to manually delete files in /tmp before rebooting)

3) The PATH environment is setup in a different file:
# Use a text editor to open $HOME/.bash_profile and add this text below:
# example: kate $HOME/.bash_profile
export PATH="${PATH}:${HOME}/android/ndk-toolchain"
export PATH="${PATH}:${HOME}/android/gradle-4.10.3/bin"
export ANDROID_SDK_ROOT="$HOME/android/sdk"

4) When setting LAMW paths, the JDK has a different path on Manjaro
# Select Tools menu > [Lamw] Android Module Wizard > Paths Settings: [Jdk, Sdk, Ndk, ...]:
...
# Path to Java JDK: /usr/lib/jvm/java-8-openjdk

Comments for 2019-May-20 ver 1.3

> 24. #Install SDK packages and NDK
When installing the NDK using sdkmanager, you cannot select an older version, it installs the latest version.

> 26.  ./sdkmanager "platforms;android-26" "build-tools;26.0.3" "tools" "ndk-bundle" "extras;android;m2repository"
I chose to install Android platform 26.  A given Android platform also supports previous API Levels.  (usage stats for Andriod API Levels).  As of gradle plugin 3.0.0, the appropriate build-tools package is automatically downloaded if needed during the gradle build, but I included it here to work around a LAMW issue.  To view a list of available packages use ./sdkmanager --list

> 35. # download and extract Gradle 4.10.3
note to self:  LAMW uses the Gradle directory name internally to determine the Gradle version

> 42. # Use a text editor to open $HOME/.profile and add this text below:
.profile seems to be the proper file for this on Ubuntu(s).  .bashrc gets re-run for every subshell which creates multiple path entries.
(NOTE:  .profile is not called if ~/.bash_profile or ~./bash_login exist)

> 51. # Download FPCUPdeluxe
If the latest version of FPCUPdeluxe doesn't build FPC/Lazarus successfully (particularly if you're using stable/stable), try the same version that I tested.

> 59. # 1) On "Basic" tab, select FPC version "fixes3.2" & Lazarus version "fixes2.0"
Originally I used trunk for both FPC and Lazarus in order to work with the most current code.  Depending the state of Lazarus/FPC in regards to bugs and ARM/Android issues, you may have to use different versions.  As of 2019-May-20, FPC trunk is causing a "buffer error" when starting Lazarus.  I switched to the latest "fixes" versions of both FPC and Lazarus which are newer than "stable", but more stable than "trunk".  There are some android related bugs fixed in FPC development version 3.1.1 and later (see here).

> 62. # 4) On Modules tab, select LAMW, Install module
Installing LAMW from FPCUPdeluxe pulls from GIT.  Do this anytime you want to update LAMW to the latest code.

2019-May-20
Building a simple test project:

Project | New Project...
LAMW [GUI] Android Module
Set project folder, (ex. /home/user/test)
Automated Build = Gradle
For 32-bit:  Architecture/Instructions = ARMv7a + VFPv3
For 64-bit:  Architecture/Instructions = Aarch64
Use defaults for other settings
Click OK
Click Save if prompted to save files
Drop a label, edit box, button on the form from Android Bridge Component Tab (jTextView, jEditText, jButton)
Run | Build
From a command line run "gradle_local_build.sh" from the project folder
if successful, your compiled APK files are in ./build/outputs/apk

Installing and Using the Android Emulator:
(the method described here uses the command line, another method is to install Android Studio)

#Install the emulator and a system image
cd ~/android/sdk/tools/bin
./sdkmanager "emulator" "system-images;android-24;default;armeabi-v7a"
(to get a list of system images use ./sdkmanager --list)

#Create some android virtual devices (AVD)
#generic test device
./avdmanager create avd -n "my_test_device" -k "system-images;android-24;default;armeabi-v7a"
#Galaxy Nexus device
./avdmanager create avd -n "Galaxy_Nexus" -d "Galaxy Nexus" -k "system-images;android-24;default;armeabi-v7a"
(to get a list of devices use ./avdmanager list devices)
(after creation, AVD files are stored in:  ~/.android/avd/)

#Run the emulator
cd ~/android/sdk/emulator
./emulator -no-snapshot-load -avd "my_test_device" -use-system-libs -gpu swiftshader_indirect
(to get a list of available AVDs, use ./emulator -list-avds)
(note: I had to use -gpu swiftshader_indirect to enable software rendering since I am running inside a virtual machine, more info here.  Inside my VM the emulator was running slow, so if you get any android "Process isn't responding" messages, click "Wait".  The emulator was unstable when loading from a snapshot, the workaround is to use -no-snapshot-load)

#Run your project in the emulator:
From a command line run "gradle_local_run.sh",
or from the Lazarus IDE menu select Run | [LAMW] Build Android Apk and Run

How to build demos
(still working on it. but have had some success by doing steps below as a 32-bit example):

Open a demo project and change
In Project | Project Options | Compiler Options | Paths

Libraries:
/home/[user]/android/sdk/ndk-bundle/platforms/android-27/arch-arm/usr/lib/;/home/[user]/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/
(remove [user] and replace with your user name)

Target File name:
../libs/armeabi-v7a/libcontrols

In Project | Project Options | Compiler Options | Custom Options
-Xd -CfVFPv3 -CpARMV7A -XParm-linux-androideabi- -FD/home/[user]/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin
(remove [user] and replace with your user name)
 
Run gradle_local_build.sh from a command line.
« Last Edit: June 13, 2021, 12:16:19 am by WayneSherman »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2052
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe / LAMW)
« Reply #3 on: April 03, 2018, 02:09:41 am »

Hello, WayneSherman!

First: Thank you!  [I added your tutorial to git LAMW!]

About  "How to build demos"

We need some test,  Can you help?  [Please,  update your LAMW...  there is some bug fixed!]

1)  Open a demo and save it ...  what config changes you got [Libraries and Custom...]?

2)  Open a demo and and try "Run--> build" what config changes you got [Libraries and Custom...]?

The code is here: LAMW  "android_wizard\smartsesigner.pas"
Quote
  if IsDemoProject() then
  begin
    TryChangeDemoProjecPaths();
  end
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

WayneSherman

  • Full Member
  • ***
  • Posts: 119
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe / LAMW)
« Reply #4 on: April 03, 2018, 05:54:50 am »
About  "How to build demos"
We need some test,  Can you help?  [Please,  update your LAMW...  there is some bug fixed!]

Yes, I can help.  Let's move to a new thread please.
See "[LAMW] Getting Demos to Build" here:  https://forum.lazarus.freepascal.org/index.php/topic,40756.0.html

WayneSherman

  • Full Member
  • ***
  • Posts: 119
Re: Setup Android Development Environment on Linux (FPCUPdeluxe / LAMW)
« Reply #5 on: April 17, 2018, 05:08:25 am »
See updates to Post #3 above

Building a simple test project:
(fixed an error, and simplified due to improvements in LAMW)

Installing and Using the Android Emulator:
(the method described here uses the command line, another method is to install Android Studio)

How to build demos
(simplified due to some improvements in LAMW, but there are some more changes needed in LAMW to automatically generate correct build settings)

HobbyDev

  • New Member
  • *
  • Posts: 25
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #6 on: April 17, 2018, 09:59:03 pm »
Something I am doing wrong!

Since I am on Arch Linux I had to find out where to get the right packages...
But now - after running FPCUPdeluxe - i got several times the message:
Quote
Fpcupdeluxe has [created] a shortcut link in your home-directory to start Lazarus.
Shortcut-link: Lazarus_fpcupdeluxe
Lazarus MUST be started with this link !!
Fpcupdeluxe has also (tried to) create a desktop shortcut with the same name.
I do not have the "Android Module Wizard" in the tools menu. What can I check to get it done?

Thanks in advanced!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2052
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #7 on: April 17, 2018, 10:11:15 pm »

> 50. # 3)

[FPCUPdeluxe] In module list:  Select LAMW, Install module
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

WayneSherman

  • Full Member
  • ***
  • Posts: 119
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #8 on: April 17, 2018, 11:57:17 pm »
> 50. # 3)
>[FPCUPdeluxe] In module list:  Select LAMW, Install module

Two other things to check:
1) Check if FPCUpdeluxe downloaded the LAMW files.  On my computer the LAMW files are found in ~/fpcupdeluxe/ccr/lamw
2) Read the FPCUpdeluxe log messages to see if there are any errors recompiling Lazarus

HobbyDev

  • New Member
  • *
  • Posts: 25
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #9 on: April 18, 2018, 08:10:35 am »
Yes the LAMW ist installed. Checking the directory /home/user/fpcupdeluxe/ccr/lamw I found 11948 objects  with a total size of 61,5 MB.
But where to find the FPCUpDeluxe Log- files? If I am running the script I get the following messages in the terminal:
Code: Pascal  [Select][+][-]
  1. $ ./Lazarus_fpcupdeluxe
  2. using config file /home/user/fpcupdeluxe/lazarus/lazarus.cfg
  3. SetPrimaryConfigPath NewValue="/home/user/fpcupdeluxe/config_lazarus" -> "/home/user/fpcupdeluxe/config_lazarus"
  4. SetPrimaryConfigPath NewValue="/home/user/fpcupdeluxe/config_lazarus" -> "/home/user/fpcupdeluxe/config_lazarus"
  5. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/user/fpcupdeluxe/config_lazarus"
  6. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
  7. Looking for code tools config file:  "/home/user/fpcupdeluxe/config_lazarus/codetoolsoptions.xml"
  8. NOTE: codetools config file not found - using defaults
  9. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 FPC=True LCL=False
  10. NOTE: help options config file not found - using defaults
  11. TComponentTreeView.SetSelection: Updating component node values.

I did the LAMW installation again. This is a part of the log from FPCUpDeluxe:
Code: Pascal  [Select][+][-]
  1. Name=lamw
  2. Description="A wizard to create JNI Android loadable module (.so) in Lazarus/Free Pascal using [datamodule like] Form Designer and Components!"
  3. Installdir=$(basedir)/ccr/$(name)
  4. Enabled=0
  5. GitURL=https://github.com/jmpessoa/lazandroidmodulewizard
  6. ArchiveURL=https://github.com/jmpessoa/lazandroidmodulewizard/archive/master.zip
  7. AddPackage1=$(Installdir)/lamw-master/android_bridges/tfpandroidbridge_pack.lpk
  8. AddPackage2=$(Installdir)/lamw-master/android_wizard/lazandroidwizardpack.lpk
  9. AddPackage3=$(Installdir)/lamw-master/ide_tools/amw_ide_tools.lpk
  10. UnInstall=rm -Rf $(Installdir)
  11.  
  12. [color=red]fpcupdeluxe: WARNING: UniversalInstaller (AddPackages): Package tfpandroidbridge_pack.lpk not found ... skipping.[/color]
  13. fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: tfpandroidbridge_pack): Removing package from config-files
  14. fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: tfpandroidbridge_pack): Going to uninstall package
  15. fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: tfpandroidbridge_pack): Checking lpl file for tfpandroidbridge_pack.lpk
  16. fpcupdeluxe: WARNING: UniversalInstaller (UnInstallPackage: tfpandroidbridge_pack): Package lazandroidwizardpack.lpk not found ... skipping.
  17. fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: lazandroidwizardpack): Removing package from config-files
  18. fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: lazandroidwizardpack): Going to uninstall package
  19. fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: lazandroidwizardpack): Checking lpl file for lazandroidwizardpack.lpk
  20. [color=red]fpcupdeluxe: WARNING: UniversalInstaller (UnInstallPackage: lazandroidwizardpack): Package amw_ide_tools.lpk not found ... skipping.[/color]
  21. fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: amw_ide_tools): Removing package from config-files
  22. fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: amw_ide_tools): Going to uninstall package
  23. fpcupdeluxe: info: UniversalInstaller (UnInstallPackage: amw_ide_tools): Checking lpl file for amw_ide_tools.lpk
  24.  
  25.  
  26. SUCCESS: Fpcupdeluxe ended without errors.
  27.  
  28. Fpcupdeluxe has [created] a shortcut link in your home-directory to start Lazarus.
  29. Shortcut-link: Lazarus_fpcupdeluxe
  30. Lazarus MUST be started with this link !!
  31. Fpcupdeluxe has also (tried to) create a desktop shortcut with the same name.

Hope that helps...
« Last Edit: April 18, 2018, 08:19:01 am by HobbyDev »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1530
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #10 on: April 18, 2018, 08:16:32 am »
@HobbyDev
Could you give more details about the errors you encounter ? Your last post does not give much info.
* Does Lazarus start ?
* Do you have LAMW in the tools of Lazarus ?

(I am the maintainer of fpcupdeluxe)

HobbyDev

  • New Member
  • *
  • Posts: 25
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #11 on: April 18, 2018, 08:22:29 am »
I just edited (extented) my last post. Please check this  :)
Yes - Lazarus is starting, and no I don't see anything regarding LAMW in Lazarus

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1530
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #12 on: April 18, 2018, 08:43:27 am »
Yes, this helps !

It seems that fpcupdeluxe was not able to find the LAMW files (reason yet unknown to me), so the most easy thing is to install LAMW manually.

Start Lazarus.
Click "Package" and Click "Open Package File (.lpk)"
Navigate towards (in ccr): android_bridges/tfpandroidbridge_pack.lpk
Click "Use"and click "Ïnstall"
Do the above also for:
android_wizard/lazandroidwizardpack.lpk
ide_tools/amw_ide_tools.lpk

This should give you LAMW tools in Lazarus.

Good luck !

WayneSherman

  • Full Member
  • ***
  • Posts: 119
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #13 on: April 18, 2018, 09:56:08 am »
I just edited (extented) my last post. Please check this  :)
Yes - Lazarus is starting, and no I don't see anything regarding LAMW in Lazarus

In FPCUPdeluxe, I re-tested the FPC/Lazarus install, and at the moment Lazarus trunk does not compile (also stable/stable causes a compiler runtime error when compiling Lazarus).  I did get FPC trunk and Lazarus stable to work.  (tested with FPCUPdeluxe v1.6.0p)

Another possible clue regarding your installation of the LAMW module, my package paths are different from yours:

(excerpt from FPCUPdeluxe log)
  Name=lamw
  Description="A wizard to create JNI Android loadable module (.so) in Lazarus/Free Pascal using [datamodule like] Form Designer and Components!"
  Installdir=$(basedir)/ccr/$(name)
  Enabled=0
  GitURL=https://github.com/jmpessoa/lazandroidmodulewizard
  ArchiveURL=https://github.com/jmpessoa/lazandroidmodulewizard/archive/master.zip
  AddPackage1=$(Installdir)/android_bridges/tfpandroidbridge_pack.lpk
  AddPackage2=$(Installdir)/android_wizard/lazandroidwizardpack.lpk
  AddPackage3=$(Installdir)/ide_tools/amw_ide_tools.lpk
  UnInstall=rm -Rf $(Installdir)


Your paths have an additional directory:
AddPackage1=$(Installdir)/lamw-master/android_bridges/tfpandroidbridge_pack.lpk
AddPackage2=$(Installdir)/lamw-master/android_wizard/lazandroidwizardpack.lpk
AddPackage3=$(Installdir)/lamw-master/ide_tools/amw_ide_tools.lpk
« Last Edit: April 18, 2018, 10:19:22 am by WayneSherman »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1530
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #14 on: April 18, 2018, 10:14:05 am »
@WayneSherman

I presume that HobbyDev does not have GIT installed. If not GIT available, fpcupdeluxe will download the LAMW-sources as a zip. This will add the extra path, but this should also be handled automagically by fpcupdeluxe, but not in the case of HobbyDev. And that is a strange error !

 

TinyPortal © 2005-2018