[HowTo] Android Development Environment on Windows (FPCUPdeluxe + LAMW) lazarus / 43-Android ---------------------------------------------------------------------- WayneSherman · 2022-05-02 02:19 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.h tml#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 ---------------------------------------------------------------------- af0815 · 2022-05-02 05:37 Thanks, for this Info. It is not better to add this article to the Wiki or update the infos at LAMW ? (If not done) ---------------------------------------------------------------------- WayneSherman · 2022-05-02 13:46 [Reserved] ---------------------------------------------------------------------- WayneSherman · 2022-05-02 13:59 Quote from: af0815 on May 02, 2022, 07:37:37 amThanks, 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. ---------------------------------------------------------------------- jmpessoa · 2022-05-02 17:07 Quoteif 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" ...  QuoteOption c) Fpcupdeluxe (Linux and Windows) Linux + Fpcupdeluxe + LAMW which currently points to: "https://github.com/jmpessoa/lazandroidmodulewizard/tree/master/docs/l inux/tutorial_by_waynesherman" (But I cant point up to "https://forum.lazarus.freepascal.org/index.php/topic,40750.0.html") What about? ---------------------------------------------------------------------- PStechPaul · 2023-02-05 07:41 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i At line:1 char:1+ Invoke-WebRequest "https://github.com/LongDirtyAnimAlf/fpcupdeluxe/re ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc   eption    + FullyQualifiedErrorId : WebCmdletWebResponseExcep tion,Microsoft.PowerShell.Commands.InvokeWebRequestCommandPS C:\Users\paul\android\fpcupdeluxe_app> "[General]" > fpcupdeluxe.iniPS C:\Users\paul\android\fpcupdeluxe_app> "InstallDirectory=$HOME\android\fpc-lazarus" >> fpcupdeluxe.iniPS C:\Users\paul\android\fpcupdeluxe_app> .\fpcupdeluxe-x86_64-win64.exe.\fpcupdeluxe-x86_64-win64.exe : The term '.\fpcupdeluxe-x86_64-win64.exe' is not recognized as the name of a cmdlet,function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that thepath is correct and try again.At line:1 char:1+ .\fpcupdeluxe-x86_64-win64.exe+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : ObjectNotFound: (.\fpcupdeluxe-x86_64-win64.exe:String) [], CommandNotFoundException  + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\paul\android\fpcupdeluxe_app> .\fpcupdeluxe-x86_64-win64.exe.\fpcupdeluxe-x86_64-win64.exe : The term '.\fpcupdeluxe-x86_64-win64.exe' is not recognized as the name of a cmdlet,function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that thepath is correct and try again.At line:1 char:1+ .\fpcupdeluxe-x86_64-win64.exe+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : ObjectNotFound: (.\fpcupdeluxe-x86_64-win64.exe:String) [], CommandNotFoundException  + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\paul\android\fpcupdeluxe_app> .\fpcupdeluxe-x86_64-win64.exe.\fpcupdeluxe-x86_64-win64.exe : The term '.\fpcupdeluxe-x86_64-win64.exe' is not recognized as the name of a cmdlet,function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that thepath is correct and try again.At line:1 char:1+ .\fpcupdeluxe-x86_64-win64.exe+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : ObjectNotFound: (.\fpcupdeluxe-x86_64-win64.exe:String) [], CommandNotFoundException  + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\paul\android\fpcupdeluxe_app> ren "$HOME\Desktop\Lazarus_fpc- lazarus.lnk" "Lazarus LAMW.lnk"ren : Cannot rename because item at 'C:\Users\paul\Desktop\Lazarus_fpc-lazarus.lnk' does not exist.At line:1 char:1+ ren "$HOME\Desktop\Lazarus_fpc-lazarus.lnk" "Lazarus LAMW.lnk"+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : InvalidOperation: (:) [Rename-Item], PSInvalidOperationException    + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.RenameItemCommand ---------------------------------------------------------------------- loaded · 2023-02-05 09:11 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 ---------------------------------------------------------------------- WayneSherman · 2023-02-05 16:26 Quote from: PStechPaul on February 05, 2023, 08:41:40 amI 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: Quote from: PStechPaul on February 05, 2023, 08:41:40 amCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i At line:1 char:1+ Invoke-WebRequest "https://github.com/LongDirtyAnimAlf/fpcupdeluxe/re ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc   eption  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/rel eases/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? ---------------------------------------------------------------------- PStechPaul · 2023-02-05 23:11 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 · 2023-02-06 02:02 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 · 2023-02-06 08:42 MOVED to Wiki: 2023-Feb-06 https://wiki.freepascal.org/LAMW_install_windows_fpcupdeluxe ---------------------------------------------------------------------- WayneSherman · 2023-02-06 08:44 Quote from: PStechPaul on February 06, 2023, 03:02:41 amOne 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 · 2023-05-21 07:02 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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-devsudo apt install -y git subversion make build-essential gdb zip unzip unrar wgetsudo apt install -y openjdk-11-jdk android- tools-adbtoCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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-devsudo apt install -y git subversion make build-essential gdb zip unzip unrar wgetsudo apt install -y freeglut3sudo apt install -y binutils 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 · 2023-05-21 15:26 Quote from: KoBraSoft on May 21, 2023, 09:02:08 amI 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