Recent

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

WayneSherman

  • Full Member
  • ***
  • Posts: 243
MOVED to Wiki: 2023-Feb-06
https://wiki.freepascal.org/LAMW_install_windows_fpcupdeluxe

As of 2023-Feb-06, this error is still happening:
https://forum.lazarus.freepascal.org/index.php/topic,21919.msg441567.html#msg441567

Changes

2023-Feb-05 ver 0.7
 Use $BASE for installation directory (defaults to $HOME)
 Tested on Win10 Pro 22H2 64-bit
 Android Command-Line Tools for Linux build 9477386
 OpenJDK 11.0.18 LTS (Microsoft's build)
 Gradle 6.8.3 (installed automatically by FPCUPdeluxe)
 FPCUPdeluxe ver 2.2.0n
 Lazarus stable v2.2.4

2022-May-01 ver 0.6 - Initial release
 Tested on Win10 Pro 21H2 64-bit
 Android Command-Line Tools for Linux build 8092744
 OpenJDK 11.0.14 LTS (Microsoft's build)
 Gradle 7.3.1 (installed automatically by FPCUPdeluxe)
 FPCUPdeluxe ver 2.2.0i
 FPC stable v3.2.2
 Lazarus stable v2.2.0
« Last Edit: February 06, 2023, 11:03:04 pm by WayneSherman »

af0815

  • Hero Member
  • *****
  • Posts: 1284
Thanks, for this Info. It is not better to add this article to the Wiki or update the infos at LAMW ? (If not done)
regards
Andreas

WayneSherman

  • Full Member
  • ***
  • Posts: 243
[Reserved]

WayneSherman

  • Full Member
  • ***
  • Posts: 243
Thanks, for this Info. It is not better to add this article to the Wiki or update the infos at LAMW ?

You're welcome.  There are too many places to find information, which makes it difficult to maintain and keep up to date.  It is especially difficult for beginners to know where to look and what to do.  I think the best place for these LAMW/FPCUPdeluxe installation guides would be in the LAMW Github project if Jose Marques Pessoa would allow that.
« Last Edit: May 02, 2022, 04:04:11 pm by WayneSherman »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Quote
if Jose Marques Pessoa would allow that...

Sure!

What about put the "how to" content directly in page "wiki.freepascal.org/LAMW_on_Linux"

then I will  link it to  LAMW Github project  "readme.md" ... 

Quote
Option c) Fpcupdeluxe (Linux and Windows)

Linux + Fpcupdeluxe + LAMW

which currently points to:

"https://github.com/jmpessoa/lazandroidmodulewizard/tree/master/docs/linux/tutorial_by_waynesherman"


(But I cant point up to "https://forum.lazarus.freepascal.org/index.php/topic,40750.0.html")


What about?
« Last Edit: May 02, 2022, 07:15:34 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
Re: [HowTo] Android Development Environment on Windows (FPCUPdeluxe + LAMW)
« Reply #5 on: February 05, 2023, 08:41:40 am »
I tried executing the commands in PowerShell and they worked, up to a point, but then I got errors. I am still unable to use Laz4Android to create Android apps. I saved the error messages.

These are probably the first:
Code: Pascal  [Select][+][-]
  1. At line:1 char:1
  2. + Invoke-WebRequest "https://github.com/LongDirtyAnimAlf/fpcupdeluxe/re ...
  3. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4.     + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
  5.    eption
  6.     + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
  7. PS C:\Users\paul\android\fpcupdeluxe_app> "[General]" > fpcupdeluxe.ini
  8. PS C:\Users\paul\android\fpcupdeluxe_app> "InstallDirectory=$HOME\android\fpc-lazarus" >> fpcupdeluxe.ini
  9. PS C:\Users\paul\android\fpcupdeluxe_app> .\fpcupdeluxe-x86_64-win64.exe
  10. .\fpcupdeluxe-x86_64-win64.exe : The term '.\fpcupdeluxe-x86_64-win64.exe' is not recognized as the name of a cmdlet,
  11. function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
  12. path is correct and try again.
  13. At line:1 char:1
  14. + .\fpcupdeluxe-x86_64-win64.exe
  15. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  16.     + CategoryInfo          : ObjectNotFound: (.\fpcupdeluxe-x86_64-win64.exe:String) [], CommandNotFoundException
  17.     + FullyQualifiedErrorId : CommandNotFoundException
  18.  
  19. PS C:\Users\paul\android\fpcupdeluxe_app> .\fpcupdeluxe-x86_64-win64.exe
  20. .\fpcupdeluxe-x86_64-win64.exe : The term '.\fpcupdeluxe-x86_64-win64.exe' is not recognized as the name of a cmdlet,
  21. function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
  22. path is correct and try again.
  23. At line:1 char:1
  24. + .\fpcupdeluxe-x86_64-win64.exe
  25. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  26.     + CategoryInfo          : ObjectNotFound: (.\fpcupdeluxe-x86_64-win64.exe:String) [], CommandNotFoundException
  27.     + FullyQualifiedErrorId : CommandNotFoundException
  28.  
  29. PS C:\Users\paul\android\fpcupdeluxe_app> .\fpcupdeluxe-x86_64-win64.exe
  30. .\fpcupdeluxe-x86_64-win64.exe : The term '.\fpcupdeluxe-x86_64-win64.exe' is not recognized as the name of a cmdlet,
  31. function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
  32. path is correct and try again.
  33. At line:1 char:1
  34. + .\fpcupdeluxe-x86_64-win64.exe
  35. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36.     + CategoryInfo          : ObjectNotFound: (.\fpcupdeluxe-x86_64-win64.exe:String) [], CommandNotFoundException
  37.     + FullyQualifiedErrorId : CommandNotFoundException
  38.  
  39. PS C:\Users\paul\android\fpcupdeluxe_app> ren "$HOME\Desktop\Lazarus_fpc-lazarus.lnk" "Lazarus LAMW.lnk"
  40. ren : Cannot rename because item at 'C:\Users\paul\Desktop\Lazarus_fpc-lazarus.lnk' does not exist.
  41. At line:1 char:1
  42. + ren "$HOME\Desktop\Lazarus_fpc-lazarus.lnk" "Lazarus LAMW.lnk"
  43. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  44.     + CategoryInfo          : InvalidOperation: (:) [Rename-Item], PSInvalidOperationException
  45.     + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.RenameItemCommand

loaded

  • Hero Member
  • *****
  • Posts: 824
Re: [HowTo] Android Development Environment on Windows (FPCUPdeluxe + LAMW)
« Reply #6 on: February 05, 2023, 10:11:25 am »
If you want to experience a different installation;
A sample working video where I set up Lazarus and LAMW from scratch.
https://youtu.be/_EtHi1GHSLk
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

WayneSherman

  • Full Member
  • ***
  • Posts: 243
Re: [HowTo] Android Development Environment on Windows (FPCUPdeluxe + LAMW)
« Reply #7 on: February 05, 2023, 05:26:26 pm »
I tried executing the commands in PowerShell and they worked, up to a point, but then I got errors.

A How-To like this is very specific and these tend to break over time.  But they are still useful because you can usually make the necessary adjustments.  Start with the first error:

Code: Pascal  [Select][+][-]
  1. At line:1 char:1
  2. + Invoke-WebRequest "https://github.com/LongDirtyAnimAlf/fpcupdeluxe/re ...
  3. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4.     + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
  5.    eption
  6.  

Read these lines and think about what the script is trying to do:

Code: [Select]
2022-May-01
...
# Download FPCUPdeluxe from https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/latest
# (tested with version 2.2.0i)
...
Invoke-WebRequest "https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v2.2.0i/fpcupdeluxe-x86_64-win64.exe" -OutFile "fpcupdeluxe-x86_64-win64.exe

It is trying to download a file from github using powershell "Invoke-WebRequest".  What file?  Test the same download URL in your browser.  Does it work?  Why or why not?
« Last Edit: February 05, 2023, 10:17:02 pm by WayneSherman »

PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
Re: [HowTo] Android Development Environment on Windows (FPCUPdeluxe + LAMW)
« Reply #8 on: February 06, 2023, 12:11:01 am »
Yes, I see that now. It looks like the correct link is:

https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/v2.2.0n/fpcupdeluxe-x86_64-win64.exe

I'll go through the script and hopefully I'll be able to update it so it runs properly. This was rather frustrating after spending probably an hour copy/pasting each command into PowerShell and executing manually. Some of the commands (downloads and unzips) take a very long time.

Thank you for your prompt and valuable response.

I'll also try the video made by "loaded".  :)

PStechPaul

  • Jr. Member
  • **
  • Posts: 76
    • P S Technology, Inc.
Re: [HowTo] Android Development Environment on Windows (FPCUPdeluxe + LAMW)
« Reply #9 on: February 06, 2023, 03:02:41 am »
One major problem I seem to have is that my Desktop folder is actually C:\Users\Public\Desktop, whereas $HOME is C:\Users\paul, and its Desktop folder is empty. I might be able to change its properties to go to the Public Desktop, but I don't want to break anything any more than it is already. As it is, all my desktop icons have "twins". This mess probably started when I stopped using OneDrive, and I now have a link in my OneDrive\Documents folder to my normal Documents folder.

I am going to buy a new laptop computer very soon, and once I get it set up and running, I'll do a complete backup of my present Win10 machine so I don't need to worry about mucking things up. Hopefully the new machine (Win11) can be set up so it won't use OneDrive, or so that I can make sure I have local copies of my documents. And then many of my problems with Laz4Android (and other programs such as Android Studio) might install and run properly.

This is off-topic for this forum, but if anyone has some advice for fixing this issue (easily and safely). I'd appreciate it. Thanks.

WayneSherman

  • Full Member
  • ***
  • Posts: 243
« Last Edit: February 06, 2023, 11:02:50 pm by WayneSherman »

WayneSherman

  • Full Member
  • ***
  • Posts: 243
Re: [HowTo] Android Development Environment on Windows (FPCUPdeluxe + LAMW)
« Reply #11 on: February 06, 2023, 09:44:57 am »
One major problem I seem to have is that my Desktop folder is actually C:\Users\Public\Desktop, whereas $HOME is C:\Users\paul, and its Desktop folder is empty.

There is now a $BASE variable that you can set to a directory of your choice.
"$BASE\android" will be created and used for all the installed files and folders.

KoBraSoft

  • New Member
  • *
  • Posts: 20
I have tested your script with Xubuntu 23.04. Two minor changes were necessary:
1. the package freeglut3 is no longer present.
2. the package binutils must now still be installed.
I suggest to change these three lines from:
Code: Pascal  [Select][+][-]
  1. 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
  2. sudo apt install -y git subversion make build-essential gdb zip unzip unrar wget
  3. sudo apt install -y openjdk-11-jdk android-tools-adb
to
Code: Pascal  [Select][+][-]
  1. 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-dev
  2. sudo apt install -y git subversion make build-essential gdb zip unzip unrar wget
  3. sudo apt install -y freeglut3
  4. sudo apt install -y binutils
  5.  
Putting freeglut in its own line has the advantage that the script throws an error message but the remaining packages are installed.
Maybe you should consider to install every single package in a separate line.

WayneSherman

  • Full Member
  • ***
  • Posts: 243
I have tested your script with Xubuntu 23.04...

Thanks for the feedback.  Can we please move your post to the correct thread?  This thread is for Windows.

@MODERATOR, please assist to move the previous post to:
[HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
https://forum.lazarus.freepascal.org/index.php?topic=40750

 

TinyPortal © 2005-2018