Recent

Author Topic: New Version LazToApk v0.9.0.36 is available  (Read 13724 times)

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 255
    • Fresh sound.
New Version LazToApk v0.9.0.36 is available
« on: October 06, 2015, 10:29:59 pm »
Hello Forum,

I have updated laztoapk.
***** IF YOU HAVE A WORKING SETUP, THEN THERE IS NO NEED TO INSTALL 0.9.0.36! ***
This version only contains some more trace-messages. It might help some folks to find out what's wrong with their setup.

Changes: please see here: http://sourceforge.net/p/laztoapk/svn/HEAD/tree/trunk/install/Changes.txt

Files are here at sourceforge.net. PLEASE,PLEASE READ THE PDF-INSTRUCTIONS!!
http://sourceforge.net/projects/laztoapk/files/?source=navbar

Regards,
Sam

What is LazToApk?
To build a piece of software which can be installed on an arm-android device, you need Java JDK, Android SDK, Android NDK and laz4android.
LazToApk is a software which will help you to download and configure all these needed 3rd-Party Tools.
LazToApk creates&executes the batch-files to build,sign and package the final apk-file.


« Last Edit: November 11, 2016, 06:55:13 pm by DelphiFreak »
Linux Mint 20.3, Lazarus 2.3, Windows 10, Delphi 10.3 Rio, Delphi 11.1 Alexandria

eggy

  • Newbie
  • Posts: 3
Re: New Version LazToApk v0.9.0.33 is available
« Reply #1 on: November 28, 2015, 04:51:46 am »
I am new to Lazarus and all else related to it. I have downloaded laz4android1.4.4-FPC3.0.0RC2.exe and installed it. I am not clear if I need Laz2apk, if I already have installed Jave JDK, Android SDK, Android NDK, NDK tools from before I ever installed anything of Lazarus. Can you please clarify? Also, can I develop Win32 apps with Laz4android, or do I need to download another setup for this? Thanks!

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 255
    • Fresh sound.
Re: New Version LazToApk v0.9.0.33 is available
« Reply #2 on: November 28, 2015, 06:29:34 am »
Hello eggy,
welcome to the lazarus world.

First of all, laztoapk is not really needed, but should help you to setup the whole toolchain correctly.

1.) laztoapk contains a prepared lazarus project-template. ( because compiler settings and project paths must be setup correctly for android)
2.) laztoapk prepares the batch-files "build_app.bat","build_debug_apk.bat","generate_debug_key.bat","adb_install.bat".

Note1: laztoapk works only on windows platforms.
Note2: In my last conversation with the maintainer of laz4android, he told my that is waiting for the final release of FPC 3.0. Then he will build a new release of laz4android and after that I will build a new release of laztoapk. So if you don't get things working, you may want to wait a week until new versions are available, because FPC 3.0 was just released on the 25.Nov.
Linux Mint 20.3, Lazarus 2.3, Windows 10, Delphi 10.3 Rio, Delphi 11.1 Alexandria

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: New Version LazToApk v0.9.0.33 is available
« Reply #3 on: November 28, 2015, 06:43:57 am »
binary build with Lazarus for android using this tool is native or java executable which is deployed in android.

Holiday season is online now. :-)

eggy

  • Newbie
  • Posts: 3
Re: New Version LazToApk v0.9.0.33 is available
« Reply #4 on: November 28, 2015, 11:36:21 am »
I am still confused, since the laz4android I downloaded is named: laz4android1.4.4-FPC3.0.0RC2.exe, so it appears to be using FPC3.0.0RC2 already, and Lazarus 1.4.4.

Another complication is that I have the NVIDIA CodeWorks for Android installed, so my Android SDK, NDK and other stuff paths are in C:\NVPACK. When I start laz4android, it opens up a default project and compiles it without error, but that is with target set to 'default', so I am assuming it is only Windows. When I switch to 'Android' for target, all hell breaks loose. I am assuming it is a path issue, and the batch files you mention might help me resolve that. I can build Android apps from MS Visual Studio with the NVIDIA Tegra plugin already, so I know my toolchain is good. I am just new to Lazarus. I did take Pascal (Turbo Pascal) back in univeristy in 1984!

Thanks for your help.


eggy

  • Newbie
  • Posts: 3
Re: New Version LazToApk v0.9.0.33 is available
« Reply #5 on: November 28, 2015, 11:49:13 am »
One more question: Is laz4android also good as my standard lazarus install to develop Windows apps too? It seems to be, but I don't want to have to download another package if I don't have to. Thanks!

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 255
    • Fresh sound.
Re: New Version LazToApk v0.9.0.34 is available
« Reply #6 on: December 08, 2015, 01:32:05 pm »
New Version 0.9.0.34  is available for download at sourceforge.net

07.Dezember 2015 (v0.9.0.34)
- updated to download laz4android1.4.4-FPC3.0.0.7z
- fixed uggly bug. Button "Step1: Select/Create Project Folder" on tabsheet "manual" did always reset/overwrite an existing project.
- some source clean-up.
- more fixes and rework for the tabsheet "manual".
- added button to edit the project.
Linux Mint 20.3, Lazarus 2.3, Windows 10, Delphi 10.3 Rio, Delphi 11.1 Alexandria

dieselnutjob

  • Full Member
  • ***
  • Posts: 217
Re: New Version LazToApk v0.9.0.34 is available
« Reply #7 on: December 23, 2015, 12:24:43 pm »
Hello Sam,

I have successfully compiled the example project1.apk.
I am using Windows 7 64 bit, but I installed jdk 32 bit as it says in your instuctions.
The project1.apk will run on my Android 4.4 phone, but it will not run on my Android 5.1.1 phone.
if says here http://forum.lazarus.freepascal.org/index.php/topic,30546.0.html
that we need "-k-pie" compiler options for Android 5
Please can you tell me how do I configure compiler options with laztoapk?

thanks

dieselnutjob

  • Full Member
  • ***
  • Posts: 217
Re: New Version LazToApk v0.9.0.34 is available
« Reply #8 on: December 23, 2015, 12:41:04 pm »
I have modified the file C:\laztoapk\downloads\laz4android\fpc\3.0.0\bin\i386-win32\fpc.cfg
I added the line
-k-pie
When I run the application on Android 5.1.1 I am still getting "Unfortunately, Project1 has stopped"
« Last Edit: December 23, 2015, 12:46:21 pm by dieselnutjob »

dieselnutjob

  • Full Member
  • ***
  • Posts: 217
Re: New Version LazToApk v0.9.0.34 is available
« Reply #9 on: December 23, 2015, 07:21:01 pm »
comparison of adb logcat output:-

Android 5 (not working):-

I think that the problem is line 4 " No implementation found for int com.pascal.project2.LCLActivity.LCLOnCreate(android.app.Activity)"?

Code: [Select]
I/ActivityManager(24707): Start proc com.pascal.project2 for activity com.pascal.project2/.LCLActivity: pid=7179 uid=10518 gids={50518, 9997, 3003, 1028, 1015} abi=armeabi
I/art     ( 7179): Late-enabling -Xcheck:jni
I/lclapp  ( 7179): Trying to load liblclapp.so
W/linker  ( 7179): liblclapp.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
E/art     ( 7179): No implementation found for int com.pascal.project2.LCLActivity.LCLOnCreate(android.app.Activity) (tried Java_com_pascal_project2_LCLActivity_LCLOnCreate and Java_com_pascal_project2_LCLActivity_LCLOnCreate__Landroid_app_Activity_2)
D/AndroidRuntime( 7179): Shutting down VM
E/AndroidRuntime( 7179): FATAL EXCEPTION: main
E/AndroidRuntime( 7179): Process: com.pascal.project2, PID: 7179
E/AndroidRuntime( 7179): java.lang.UnsatisfiedLinkError: No implementation found for int com.pascal.project2.LCLActivity.LCLOnCreate(android.app.Activity) (tried Java_com_pascal_project2_LCLActivity_LCLOnCreate and Java_com_pascal_project2_LCLActivity_LCLOnCreate__Landroid_app_Activity_2)
E/AndroidRuntime( 7179): at com.pascal.project2.LCLActivity.LCLOnCreate(Native Method)
E/AndroidRuntime( 7179): at com.pascal.project2.LCLActivity.onCreate(LCLActivity.java:246)
E/AndroidRuntime( 7179): at android.app.Activity.performCreate(Activity.java:5933)
E/AndroidRuntime( 7179): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
E/AndroidRuntime( 7179): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
E/AndroidRuntime( 7179): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
E/AndroidRuntime( 7179): at android.app.ActivityThread.access$800(ActivityThread.java:144)
E/AndroidRuntime( 7179): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
E/AndroidRuntime( 7179): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 7179): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 7179): at android.app.ActivityThread.main(ActivityThread.java:5221)
E/AndroidRuntime( 7179): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 7179): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 7179): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime( 7179): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
I/Process ( 7179): Sending signal. PID: 7179 SIG: 9
I/ActivityManager(24707): Process com.pascal.project2 (pid 7179) has died

Android 4.4 (works):-
Code: [Select]
I/Timeline(  896): Timeline: Activity_launch_request id:com.pascal.project2 time:14675263
I/ActivityManager(  556): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.pascal.project2/.LCLActivity} from pid 896
I/UsageStats(  556): Deleting usage file : usage-20151102
V/Zygote  ( 5754): Switching descriptor 32 to /dev/null
V/Zygote  ( 5754): Switching descriptor 9 to /dev/null
D/dalvikvm( 5754): Late-enabling CheckJNI
I/ActivityManager(  556): Start proc com.pascal.project2 for activity com.pascal.project2/.LCLActivity: pid=5754 uid=10063 gids={50063, 3003, 1028, 1015, 1023}
I/dalvikvm( 5754): Enabling JNI app bug workarounds for target SDK version 8...
V/PhoneStatusBar(  674): setLightsOn(true)
I/lclapp  ( 5754): Trying to load liblclapp.so
D/dalvikvm( 5754): Trying to load lib /data/app-lib/com.pascal.project2-1/liblclapp.so 0x41e41190
D/dalvikvm( 5754): Added shared lib /data/app-lib/com.pascal.project2-1/liblclapp.so 0x41e41190
I/lclapp  ( 5754): JNI_OnLoad called
I/lclapp  ( 5754): Reading our Activity Class
I/lclapp  ( 5754): JNI_OnLoad finished
I/lclapp  ( 5754): LCLOnCreate called by LCLActivity.onCreate
I/lclapp  ( 5754): [TCDWSCustomForm.ShowHide] First form layout adjustment lOldDPI=96 lNewDPI=213 lOldFormWidth=253 lNewFormWidth=100
D/libEGL  ( 5754): loaded /system/lib/egl/libEGL_tegra.so
E/        ( 5754): file /data/data/com.nvidia.NvCPLSvc/files/driverlist.txt: not found!
I/        ( 5754): Attempting to load EGL implementation /system/lib//egl/libEGL_tegra_impl
I/        ( 5754): Loaded EGL implementation /system/lib//egl/libEGL_tegra_impl
D/libEGL  ( 5754): loaded /system/lib/egl/libGLESv1_CM_tegra.so
D/libEGL  ( 5754): loaded /system/lib/egl/libGLESv2_tegra.so
I/        ( 5754): Loading GLESv2 implementation /system/lib//egl/libGLESv2_tegra_impl
D/OpenGLRenderer( 5754): Enabling debug mode 0
I/lclapp  ( 5754): [LCLOnConfigurationChanged] i=0 lOldDPI=213 lNewDPI=213 lOldFormWidth=100 lNewFormWidth=720
I/Timeline( 5754): Timeline: Activity_idle id: android.os.BinderProxy@41e3cc00 time:14675822
I/ActivityManager(  556): Displayed com.pascal.project2/.LCLActivity: +470ms
I/Timeline(  556): Timeline: Activity_windows_visible id: ActivityRecord{41f1ae48 u0 com.pascal.project2/.LCLActivity t6} time:14675832
I/healthd (  138): battery l=30 v=3 t=20.3 h=2 st=2 chg=u
I/lclapp  ( 5754): [TCDWidgetSet.AppTerminate] Start
I/AndroidRuntime( 5754): VM exiting with result code 0, cleanup skipped.
I/ActivityManager(  556): Process com.pascal.project2 (pid 5754) has died.
I/WindowState(  556): WIN DEATH: Window{41fe7518 u0 com.pascal.project2/com.pascal.project2.LCLActivity}
W/ActivityManager(  556): Force removing ActivityRecord{41f1ae48 u0 com.pascal.project2/.LCLActivity t6}: app died, no saved state
W/InputMethodWrapper(  783): Incoming session is null
W/InputMethodManagerService(  556): Got RemoteException sending setActive(false) notification to pid 5754 uid 10063
I/Timeline(  896): Timeline: Activity_idle id: android.os.BinderProxy@41e3cb90 time:14678395
I/Timeline(  556): Timeline: Activity_windows_visible id: ActivityRecord{42189ba8 u0 com.slim.slimlauncher/.Launcher t1} time:14678694

tomkemp

  • Newbie
  • Posts: 6
Re: New Version LazToApk v0.9.0.34 is available
« Reply #10 on: December 31, 2015, 11:25:37 am »
Hi,

I have exactly the same problem. I can't run lcl Android applications on Android 5, 5.1 etc. I tried compile code on Windows and Linux. I don't have any idea why it doesn't work.

-k-pie option causes that application closing with  "Unfortunately, Project1 has stopped" message, without that option application close without any information.

I found that with -k-pie option on Android 2.2 ( old Samsung device ) running application is not possible.

Anybody run with success LCL application on Android 5 ?


CrayfishDTim

  • Newbie
  • Posts: 4
Re: New Version LazToApk v0.9.0.34 is available
« Reply #11 on: February 15, 2016, 02:50:40 pm »
Same Probleme here =/ somebody please help us  :'(

Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
Re: New Version LazToApk v0.9.0.34 is available
« Reply #12 on: February 15, 2016, 04:07:11 pm »
@tomkemp, @CrayfishDTim

Are you running the apk on Intel-based Android devices? AFAIK, LazToApk still can't generate codes for Intel-based machines properly. It's still on the early stage, most of the efforts are focus on ARM devices.

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 255
    • Fresh sound.
Re: New Version LazToApk v0.9.0.34 is available
« Reply #13 on: February 15, 2016, 08:24:07 pm »
Hi,

if you want to try laztoapk with intel stuff, then we need to change some things.
You could help me to do that, because I have not much time.

So if you have time, then look at this code:

Line 977:  https://sourceforge.net/p/laztoapk/svn/HEAD/tree/trunk/source/apkmanagermain.pas

The method
Code: Pascal  [Select][+][-]
  1. function TfrmApkManager.CopyNDKFilesToFPC: boolean;
copies the arm- files to the fpc folder.
So if you want to use intel stuff, this probably would need to copy the intel-files from ndk to fpc folder.

Then you would need to adjust the files in C:\laztoapk\TemplateProject.   e.g. if you look at file templatemain.pas you see $ifdef CPUARM}
You must also analyze the other files: see templateandroid.lpi line 90: -->        <CustomOptions Value="-dANDROID -Xd -CpARMV6"/>

And so on. Sorry I have not time at the moment but if you get it working I will update laztoapk so you could select CPU.

Thank you,
Sam
Linux Mint 20.3, Lazarus 2.3, Windows 10, Delphi 10.3 Rio, Delphi 11.1 Alexandria

CrayfishDTim

  • Newbie
  • Posts: 4
Re: New Version LazToApk v0.9.0.34 is available
« Reply #14 on: February 16, 2016, 10:02:27 am »
but i have a S5 with ARMv7

on s4 everything works fine

 

TinyPortal © 2005-2018