It feels like a big leaky boat. Question 1 lazarus / 43-Android ---------------------------------------------------------------------- gary · 2024-12-21 04:06 My Environment : windows 11 Lazarus 3.0 (rev f771d54e) FPC 3.2.2 x86_64-win64-win32/win64 LAMW 0.8.6.4 JDK-21 apache-ant-1.10.14 gradle-8.6 android-ndk-r27c-windows Android SDK Platform-Tools 35.0.2 Android SDK Build-Tools 36-rc3 Android 14.0 ("UpsideDownCake") Question  1    a) Project - New Project - LAMW [GUI] Android Module    b) Run - Compile (why the following error occurs)    unit1.pas(31,0) Error: Assembler arm-linux-androideabi-as.exe not found, switching to external assembling Compile Project, OS: android, CPU: arm, Target: C:\lazarus\projects\LA MWProjects\AppLAMWProject12\libs\armeabi-v7a\libcontrols.so Compile Reason: State file "C:\lazarus\projects\LAMWProjects\AppLAMWPr oject12\obj\controls\controls.compiled" of Project is missing. Executable: C:\lazarus\fpc\bin\x86_64-win64\fpc.exe CurrentDirectory: C:\lazarus\projects\LAMWProjects\AppLAMWProject12\jni\ Parameters: -B -Tandroid -Parm -Mdelphi -Scghim -CX -Os3 -Xs -XX -l -vewnhibq -FlC:\android-ndk-r27c-windows\android- ndk-r27c\toolchains\llvm\prebuilt\windows\sysroot\usr\lib\arm-linux- androideabi\22 -FlC:\android-ndk-r27c-windows\android-ndk-r27c\toolchains\arm-linux- androideabi-4.9\prebuilt\windows\lib\gcc\arm-linux-androideabi\4.9.x -FuC:\lazarus\projects\LAMWProjects\AppLAMWProject12\obj\controls -FuC:\lazarus\ccr\lamw\android_bridges\lib\arm-android -FuC:\lazarus\lazarus\lcl\units\arm-android -FuC:\lazarus\lazarus\components\freetype\lib\arm-android -FuC:\lazarus\lazarus\components\lazutils\lib\arm-android -FuC:\lazarus\lazarus\packager\units\arm-android -FuC:\lazarus\projects\LAMWProjects\AppLAMWProject12\jni\ -FUC:\lazarus\projects\LAMWProjects\AppLAMWProject12\obj\controls\ -FEC:\lazarus\projects\LAMWProjects\AppLAMWProject12\libs\armeabi-v7a\ -oC:\lazarus\projects\LAMWProjects\AppLAMWProject12\libs\armeabi- v7a\libcontrols.so -Xd -CfVFPV3 -CpARMV7A -XParm-linux-androideabi- -FDC:\android-ndk-r27c-windows\android-ndk-r27c\toolchains\arm-linux- androideabi-4.9\prebuilt\windows\bin controls.lpr Command Line: C:\lazarus\fpc\bin\x86_64-win64\fpc.exe -B -Tandroid -Parm -Mdelphi -Scghim -CX -Os3 -Xs -XX -l -vewnhibq -FlC:\android- ndk-r27c-windows\android- ndk-r27c\toolchains\llvm\prebuilt\windows\sysroot\usr\lib\arm-linux- androideabi\22 -FlC:\android-ndk-r27c-windows\android- ndk-r27c\toolchains\arm-linux- androideabi-4.9\prebuilt\windows\lib\gcc\arm-linux-androideabi\4.9.x -FuC:\lazarus\projects\LAMWProjects\AppLAMWProject12\obj\controls -FuC:\lazarus\ccr\lamw\android_bridges\lib\arm-android -FuC:\lazarus\lazarus\lcl\units\arm-android -FuC:\lazarus\lazarus\components\freetype\lib\arm-android -FuC:\lazarus\lazarus\components\lazutils\lib\arm-android -FuC:\lazarus\lazarus\packager\units\arm-android -FuC:\lazarus\projects\LAMWProjects\AppLAMWProject12\jni\ -FUC:\lazarus\projects\LAMWProjects\AppLAMWProject12\obj\controls\ -FEC:\lazarus\projects\LAMWProjects\AppLAMWProject12\libs\armeabi-v7a\ -oC:\lazarus\projects\LAMWProjects\AppLAMWProject12\libs\armeabi- v7a\libcontrols.so -Xd -CfVFPV3 -CpARMV7A -XParm-linux-androideabi- -FDC:\android-ndk-r27c-windows\android-ndk-r27c\toolchains\arm-linux- androideabi-4.9\prebuilt\windows\bin controls.lpr Parsers: make, FPC ProcessID: 89548 ExitCode: 1 ExitStatus: 1 Error: Exit code 1 It's a continuous and connected problem 1、Compilation error https://forum.lazarus.freepascal.org/index.php/topic,69647.0.html 2、Invalid library address https://forum.lazarus.freepascal.org/index.php/topic,69648.0.html 3、“[LAMW]Build Android Apk and Run” failure https://forum.lazarus.freepascal.org/index.php/topic,69649.0.html 4、Build Release Signed Apk Failed https://forum.lazarus.freepascal.org/index.php/topic,69650.0.html 5、NDK Prebuild prompt not found https://forum.lazarus.freepascal.org/index.php/topic,69651.0.html 6、arm-linux-androideabi-as.exe not found https://forum.lazarus.freepascal.org/index.php/topic,69652.0.html 7. Change Chipset failed https://forum.lazarus.freepascal.org/index.php/topic,69653.0.html I feel lamw is like an aircraft carrier, powerful, but a bit leaky for a newbie, and there are a bit many leaks. Please give me guidance from the gods as well, thank you very much! ---------------------------------------------------------------------- 440bx · 2024-12-21 04:51 Good netiquette requires asking 1 question at a time. ---------------------------------------------------------------------- gary · 2024-12-21 05:08 Quote from: 440bx on December 21, 2024, 05:51:24 amGood netiquette requires asking 1 question at a time. I'm very sorry, I'm new to the forum and I was trying to make the questions continuous and relevant. ---------------------------------------------------------------------- backprop · 2024-12-21 05:37 Quote from: gary on December 21, 2024, 05:25:27 amI feel lamw is like an aircraft carrier, powerful, but a bit leaky for a newbie, and there are a bit many leaks. Please give me guidance from the gods as well, thank you very much! The best advice is not to use Lazarus for android applications at all, but only genuine software. Similar as for MCUs. I have tried both long time ago, but I give up quickly. Reasons are very simple: 1. There is no warranty this will work at all as well even this project survive in the future 2. You will get no help or quite minor. Thus, the best advice is to focus on large community for genuine Android app tools and RADs. ---------------------------------------------------------------------- Seenkao · 2024-12-21 13:34 Quote from: gary on December 21, 2024, 05:06:24 am-Os3 Что это? Уровень оптимизации? Если так, то не советую его выставлять выше уровня O2. По всему остальному я больше вижу, что у вас указанные пути не совпадают (что-то не установлено?). Проверьте правильность выставленных путей! Попробуйте использовать другой Gradle, бывают проблемы из-за версии Gradle. Если вы можете собрать свой проект в Lazarus (не APK/ABB), то можете попробовать собрать конечный APK/ABB в Android Studio (хотя там тоже настройки нужны будут и он так же использует Gradle для сборки). ----------------------------------- Google translate: What is it? Optimization level? If so, I don't recommend setting it higher than O2. In all other respects, I see more that your specified paths do not match (is something not installed?). Check that the paths are set correctly! Try using a different Gradle, sometimes problems are caused by the Gradle version. If you can build your project in Lazarus (not APK/ABB), you can try to build the final APK/ABB in Android Studio (although you will also need settings there and it also uses Gradle for building). ---------------------------------------------------------------------- gary · 2024-12-21 14:07 Quote from: backprop on December 21, 2024, 06:37:36 amQuote from: gary on December 21, 2024, 05:25:27 amI feel lamw is like an aircraft carrier, powerful, but a bit leaky for a newbie, and there are a bit many leaks. Please give me guidance from the gods as well, thank you very much! The best advice is not to use Lazarus for android applications at all, but only genuine software. Similar as for MCUs. I have tried both long time ago, but I give up quickly. Reasons are very simple: 1. There is no warranty this will work at all as well even this project survive in the future 2. You will get no help or quite minor. Thus, the best advice is to focus on large community for genuine Android app tools and RADs. I'm in an awkward situation, I only know pascal, I write code as a hobby, not as a means of earning a living, and I really don't have the energy to learn another language, so I'd like to write code in a language I'm familiar with. I really don't have the energy to learn another language, I just want to write code in a language I know. In my opinion, delphi doesn't even have a high market share, let alone lazarus, but it's always good to have a dream, and I just want to work together to solve problems, and then share the solutions so that more people can focus on the code and the algorithms instead of wasting their time with IDE bugs all the time. This is really a challenge for the lazarus team, but also for program developers. By the way: I think documentation is more important than code, if you have a good algorithm but no documentation, it's a disaster for those who come after you. Especially in terms of understanding the program quickly ---------------------------------------------------------------------- 440bx · 2024-12-21 14:12 Quote from: gary on December 21, 2024, 03:07:45 pmBy the way: I think documentation is more important than code, if you have a good algorithm but no documentation, it's a disaster for those who come after you. Especially in terms of understanding the program quickly A very good way of thinking about programming.  if the code and algorithms aren't documented, they will be of dubious value in the long run. ---------------------------------------------------------------------- ccrause · 2024-12-21 14:23 Quote from: gary on December 21, 2024, 05:06:24 amQuestion  1    a) Project - New Project - LAMW [GUI] Android Module    b) Run - Compile (why the following error occurs)    unit1.pas(31,0) Error: Assembler arm-linux-androideabi-as.exe not found, switching to external assembling arm-linux-androideabi-as.exe - if you are running Windows then I assume the compiler should call the x86_64 version of the cross assembler.  The arm version is called because of the following setting:Code: [Select]-XParm-linux-androideabi-Assuming you are running on a typical x86 architecture change this to:Code: [Select]-XPx86_64-linux-android-At least that is the convention in laz4android 3.4. Also ensure that the compiler knows where to find the relevant cross tools (e.g. use -FD). Edit: Please ignore this post, I misinterpreted the naming convention of binutils. ---------------------------------------------------------------------- Joanna · 2024-12-21 15:00 Quote from: 440bx on December 21, 2024, 05:51:24 amGood netiquette requires asking 1 question at a time. You have encouraged him to make a bunch of threads which look like they have same name. It’s very confusing and looks like spam.  Gary please use code tags for your output it’s easier for people to read your post ---------------------------------------------------------------------- gary · 2024-12-21 15:31 Quote from: Seenkao on December 21, 2024, 02:34:45 pmQuote from: gary on December 21, 2024, 05:06:24 am-Os3 Что это? Уровень оптимизации? Если так, то не советую его выставлять выше уровня O2. По всему остальному я больше вижу, что у вас указанные пути не совпадают (что-то не установлено?). Проверьте правильность выставленных путей! Попробуйте использовать другой Gradle, бывают проблемы из-за версии Gradle. Если вы можете собрать свой проект в Lazarus (не APK/ABB), то можете попробовать собрать конечный APK/ABB в Android Studio (хотя там тоже настройки нужны будут и он так же использует Gradle для сборки). ----------------------------------- Google translate: What is it? Optimization level? If so, I don't recommend setting it higher than O2. In all other respects, I see more that your specified paths do not match (is something not installed?). Check that the paths are set correctly! Try using a different Gradle, sometimes problems are caused by the Gradle version. If you can build your project in Lazarus (not APK/ABB), you can try to build the final APK/ABB in Android Studio (although you will also need settings there and it also uses Gradle for building). Yes, you're spot on, the specified paths don't match, as I've mentioned later in this series of questions and given the solution. But why is this problem occurring? Tell us the principle so that we can better understand what is the reason for his occurrence? And later on we know how to circumvent the same problem? I still don't know what is the reason for his appearance? ---------------------------------------------------------------------- TRon · 2024-12-21 15:40 Quote from: gary on December 21, 2024, 04:31:13 pmBut why is this problem occurring? Tell us the principle so that we can better understand what is the reason for his occurrence? And later on we know how to circumvent the same problem? I still don't know what is the reason for his appearance? You would have to ask the designers of LAMW that question. It is common sense, see also wiki on how to set up SDK and paths for android. I have no idea what LAMW does behind the scenes (or what you instructed LAMW to do) and since the project is targeted for windows there are many people that don't use windows and thus are not able to tell ---------------------------------------------------------------------- gary · 2024-12-21 15:53 Quote from: ccrause on December 21, 2024, 03:23:31 pmQuote from: gary on December 21, 2024, 05:06:24 amQuestion  1    a) Project - New Project - LAMW [GUI] Android Module    b) Run - Compile (why the following error occurs)    unit1.pas(31,0) Error: Assembler arm-linux-androideabi-as.exe not found, switching to external assembling arm-linux-androideabi-as.exe - if you are running Windows then I assume the compiler should call the x86_64 version of the cross assembler.  The arm version is called because of the following setting:Code: [Select]-XParm-linux-androideabi-Assuming you are running on a typical x86 architecture change this to:Code: [Select]-XPx86_64-linux-android-At least that is the convention in laz4android 3.4. Also ensure that the compiler knows where to find the relevant cross tools (e.g. use -FD). I don't use the IDE (compile), I use the gradle-local-build.bat inside the project directly and it compiles, here is the content of the gradle-local-build.bat file set Path=%PATH%;C:\Users\aaa\AppData\Local\Android\Sdk\platform-tools set GRADLE_HOME=C:\gradle-8.6\ set PATH=%PATH%;%GRADLE_HOME%\bin gradle clean build --info But why does this happen, what causes it, how do I fix it, I want to know the principle ---------------------------------------------------------------------- Seenkao · 2024-12-21 16:01 Quote from: gary on December 21, 2024, 04:53:45 pmI don't use the IDE (compile), I use the gradle-local-build.bat inside the project directly and it compiles IDE нужна для сборки Паскаль-кода, если вы не скомпилируете этот код, то вернее всего и проект не соберёте. По той причине что FPC/Lazarus собирают необходимую *.so библиотеку которая необходима для работы конечного приложения. ------------------------ Google translate: IDE is needed to build Pascal code, if you do not compile this code, then most likely you will not build the project. For the reason that FPC/Lazarus build the necessary *.so library that is necessary for the operation of the final application. ---------------------------------------------------------------------- 440bx · 2024-12-21 16:02 Quote from: Joanna from IRC on December 21, 2024, 04:00:50 pmQuote from: 440bx on December 21, 2024, 05:51:24 amGood netiquette requires asking 1 question at a time. You have encouraged him to make a bunch of threads which look like they have same name. It’s very confusing and looks like spam.  I posted that because he had _already_ posted 7 questions in a row.  You would know that if you had read his apology after I pointed out it was not good etiquette. While on the subject of etiquette, it is also good etiquette to read the posts, it prevents posting incorrect comments such as yours.  Contrary to what you stated, I _discouraged_ him from asking multiple related questions in a row in separate threads. ---------------------------------------------------------------------- ccrause · 2024-12-22 06:01 Quote from: gary on December 21, 2024, 04:53:45 pmQuote from: ccrause on December 21, 2024, 03:23:31 pmQuote from: gary on December 21, 2024, 05:06:24 amQuestion  1    a) Project - New Project - LAMW [GUI] Android Module    b) Run - Compile (why the following error occurs)    unit1.pas(31,0) Error: Assembler arm-linux-androideabi-as.exe not found, switching to external assembling arm-linux-androideabi-as.exe - if you are running Windows then I assume the compiler should call the x86_64 version of the cross assembler.  The arm version is called because of the following setting:Code: [Select]-XParm-linux-androideabi-Assuming you are running on a typical x86 architecture change this to:Code: [Select]-XPx86_64-linux-android-At least that is the convention in laz4android 3.4. Also ensure that the compiler knows where to find the relevant cross tools (e.g. use -FD). I don't use the IDE (compile), I use the gradle-local-build.bat inside the project directly and it compiles, here is the content of the gradle-local-build.bat file set Path=%PATH%;C:\Users\aaa\AppData\Local\Android\Sdk\platform-tools set GRADLE_HOME=C:\gradle-8.6\ set PATH=%PATH%;%GRADLE_HOME%\bin gradle clean build --info But why does this happen, what causes it, how do I fix it, I want to know the principle Please ignore my response above, I misinterpreted the naming convention of binutils - the triplet describes the target.... ---------------------------------------------------------------------- gary · 2024-12-22 06:47 Quote from: 440bx on December 21, 2024, 05:02:06 pmQuote from: Joanna from IRC on December 21, 2024, 04:00:50 pmQuote from: 440bx on December 21, 2024, 05:51:24 amGood netiquette requires asking 1 question at a time. You have encouraged him to make a bunch of threads which look like they have same name. It’s very confusing and looks like spam.  I posted that because he had _already_ posted 7 questions in a row.  You would know that if you had read his apology after I pointed out it was not good etiquette. While on the subject of etiquette, it is also good etiquette to read the posts, it prevents posting incorrect comments such as yours.  Contrary to what you stated, I _discouraged_ him from asking multiple related questions in a row in separate threads. I apologize for the trouble I've caused everyone, so please let's get back to the question itself. ---------------------------------------------------------------------- 440bx · 2024-12-22 07:13 Quote from: gary on December 22, 2024, 07:47:33 amI apologize for the trouble I've caused everyone, so please let's get back to the question itself. You already apologized and, for most people, including myself one heartfelt apology is sufficient. Joanna, oth, seems to have a well developed talent to create a problem where there isn't one.  Anyway, hopefully this will be the end of that in this thread. ---------------------------------------------------------------------- gary · 2024-12-22 08:42 I found that the GetPrebuiltDirectory UpdateBuildModes InitProject method in the lamw project fixes the paths in it, and when I write the lamw project, the paths are wrong, which leads to a series of problems. Because the path I fill in doesn't match the fixed address, and the fixed address doesn't have a file in it! I'm trying to understand the developer's thinking, I don't know why he did this, if you are worried about the version is not controllable, you can make a hint in a conspicuous place. BTW, I'm a newbie, I may be wrong, I'm happy for people to correct me! ---------------------------------------------------------------------- c4p · 2024-12-22 15:48 Hi Gary, I would try and keep to the recommended build spec for LAMW, I would recommend for anyone coming to LAMW for the first time to install it using LAMW Manager first, then do some coding on Android, and once you're familiar with the setup, then go and rebuild it with your own spec/versions, bearing in mind that some versions may not work correctly outside of the recommended spec and may cause your output to fail without more work being required (see recommended specs in the LAMW link below). LAMW: https://github.com/jmpessoa/lazandroidmodulewizard LAMWManager for Windows: https://github.com/dosza/LAMWManager-win LAMWManager for Linux: https://github.com/dosza/LAMWManager-linux I'm not saying what you've posted is wrong, as there could very well be a bug, I would just try to build LAMW using the recommended build spec first, then come back if the issue can be replicated with the recommended spec, I'm not sure what you're trying to do without the IDE, as it's tricky to generate an Android app without the IDE/GUI unless you're only doing a command line/terminal based app. Jmpessoa has done some amazing work with LAMW but has not had much time recently to devote to LAMW due to work pressures, and if someone can flag/report any issues and fix them, they're welcome to post the corrected code on this forum, so your input with any issues are welcome. ---------------------------------------------------------------------- Joanna · 2024-12-22 23:16 Quote from: 440bx on December 21, 2024, 05:02:06 pmQuote from: Joanna from IRC on December 21, 2024, 04:00:50 pmQuote from: 440bx on December 21, 2024, 05:51:24 amGood netiquette requires asking 1 question at a time. You have encouraged him to make a bunch of threads which look like they have same name. It’s very confusing and looks like spam.  I posted that because he had _already_ posted 7 questions in a row.  You would know that if you had read his apology after I pointed out it was not good etiquette. While on the subject of etiquette, it is also good etiquette to read the posts, it prevents posting incorrect comments such as yours.  Contrary to what you stated, I _discouraged_ him from asking multiple related questions in a row in separate threads. Ah but you were correcting him here and not on the other threads. As I said confusing ---------------------------------------------------------------------- gary · 2024-12-23 17:41 Quote from: c4p on December 22, 2024, 04:48:34 pmHi Gary, I would try and keep to the recommended build spec for LAMW, I would recommend for anyone coming to LAMW for the first time to install it using LAMW Manager first, then do some coding on Android, and once you're familiar with the setup, then go and rebuild it with your own spec/versions, bearing in mind that some versions may not work correctly outside of the recommended spec and may cause your output to fail without more work being required (see recommended specs in the LAMW link below). LAMW: https://github.com/jmpessoa/lazandroidmodulewizard LAMWManager for Windows: https://github.com/dosza/LAMWManager-win LAMWManager for Linux: https://github.com/dosza/LAMWManager-linux I'm not saying what you've posted is wrong, as there could very well be a bug, I would just try to build LAMW using the recommended build spec first, then come back if the issue can be replicated with the recommended spec, I'm not sure what you're trying to do without the IDE, as it's tricky to generate an Android app without the IDE/GUI unless you're only doing a command line/terminal based app. Jmpessoa has done some amazing work with LAMW but has not had much time recently to devote to LAMW due to work pressures, and if someone can flag/report any issues and fix them, they're welcome to post the corrected code on this forum, so your input with any issues are welcome. First of all, thank you! And then thanks again to Jmpessoa for all the work. But I'm almost sure it's a version issue, I'm using a higher version of the SDK NDK other than Jmpessoa's recommendation, and the lamw code is not very friendly to newer versions, even the directory is not correct, so there's a series of should be. So far compiling with the recommended way and version has not been a problem, but signing has been a problem again.Build Release Signed Apk prompt Unable to open file “D:\android-applAppLAMWProject5\gradle- local.... Actually the signing key was not generated, I solved it manually. It seems that the set Path path of the gradle-local-apksigner.bat file is not correct. I don't think this is reliable either