[Solved] LAMW: how to add mips target? lazarus / 43-Android ---------------------------------------------------------------------- turronet · 2017-08-20 09:37 It is possible to add the mipsel target to the ide? Thanks ---------------------------------------------------------------------- jmpessoa · 2017-08-22 21:20 Hello Turronet! I will try to add support to "mipsel"... Thank you! ---------------------------------------------------------------------- jmpessoa · 2017-09-24 21:02 Hi, Turronet! Have you  a cross-compile system  for "mipsel-android" ??? [my Laz4android (out-of-box) do not support mipsel, so I dont got a good test/debug...] ---------------------------------------------------------------------- jmpessoa · 2017-09-25 23:50 Done!  mipsel chip support added to LAMW! Thank you! ---------------------------------------------------------------------- majid.ebru · 2017-09-26 03:48 Hi waht is mipsel? thank you ---------------------------------------------------------------------- jmpessoa · 2017-09-26 03:59 A chip architecture.... ex: x86  ... arm ... mipsel Yes, some phone/device are  "mips" ... not "arm" or "x86" ---------------------------------------------------------------------- turronet · 2017-09-26 05:49 Hi all, Many thanks jmpessoa! A device that use mips cpu running android 5.1 is the huami amazfit pace, it' s a sportwatch. Ciao ---------------------------------------------------------------------- DonAlfredo · 2017-09-26 15:00 Sidenote: I have added mipsel-android crosscompiler for Windows x86 and Linux x64 into the latest version of fpcupdeluxe. ---------------------------------------------------------------------- turronet · 2017-09-28 11:04 Hi All, Now I'm able to create an hello world apk with mipsel Unfortunately I get force close in the mips avd emulator and wrong abis while sending apk to smartwatch. Apk created with arm target runs well on phone and tablet so the lamw is more or less tuned. Next step will be trying fpc 3.1.1 instead of 3.0.4. Hopefully it's only a matter of ndk,sdk and fpc versions Let's see ---------------------------------------------------------------------- turronet · 2017-09-30 09:16 A little update: ...lib/mipsel/libcontrol.so has to be lib/mips/libcontrol.so.... After that modification in the target setting within lazarus I'm able to run the apk in the avd and installing apk in the smartwatch. "Unfortunately bla.apk has stopped" is what I get in the device ( no issues in the avd) The battle continue... ---------------------------------------------------------------------- jmpessoa · 2017-09-30 22:01 Quote...lib/mipsel/libcontrol.so has to be lib/mips/libcontrol.so.... Fixed! Thank you! ---------------------------------------------------------------------- turronet · 2017-10-01 15:20 Hello Jmpessoa, I tried but it asked me to create mipsel folder, this means that target name (-o option) wasn't updated. I kindly ask You an help, I'm not so good in android and java (otherwise I would use android studio..) and I like lazarus, so I would like to understand why I'm not able to create apk for my target device. Always talking about an hello world app these are the results achieved: If I create an apk for arm, everything is fine on both emu and devices (moto g5+, kindle fire 8, etc...) so great job , really well done! If I create a console app (not JNI) for mips(el) everything is fine on both emu and device (huami amazfit pace) which runs 5.1.1 sdk 22. If I create a GUI (JNI) apk for mips(el) it's running well on mips emulator, but I get "unfortunately x.apk has stopped" on the device If I create a Console (JNI) apk for mips(el) it's running well on mips emulator, but I get "unfortunately x.apk has stopped" on the device I attached the logcat I'm not expert but it seems the failure is due to lib loading and function addresses... how about this? I read some issues on PIC libraries and fpc+android, but no way to get libcontrol.so built with -Cg- flags. Could You kindly send me a mips apk so I can check if it behaves the same? many thanks for Your help Valerio ---------------------------------------------------------------------- jmpessoa · 2017-10-01 19:12 Quote this means that target name (-o option) wasn't updated. Sorry.... fixed! From log: QuoteF/art     ( 5232): art/runtime/runtime.cc:289] java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.hide()' on a null object reference F/art     ( 5232): art/runtime/runtime.cc:289]   at void org.lamw.lamwguiproject18.jForm.HideActionBar() (Controls.java:625) If you have some "HideActionBar()"  in your pascal code,  try to comment it.... ---------------------------------------------------------------------- turronet · 2017-10-01 22:17 Thanks for the fix, now it is fine. Have You changed something else recently? "[Lamw] Build and run apk" now opens a terminal which closes almost immediatley so I can't see what's happen, it says all green all the times in the message windows but actually if it fails for some reason You don't know. Manually launching the scripts build-debug and install work perfectly (at least I know the reason of failure) Coming back to "my problem" I found a way to avoid actionbar but unfortunately it fails just after... 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 W/linker  ( 9999): libcontrols.so: unused DT entry: type 0x6ffffffe arg 0xf48W/linker  ( 9999): libcontrols.so: unused DT entry: type 0x6fffffff arg 0x2W/linker  ( 9999): libcontrols.so has text relocations. This is wasting memory and prevents security hardening. Please fix.W/art     ( 9999): Can't call EnsureArtActionInFrontOfSignalChain due to unitialized fault managerF/art     ( 9999): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI GetObjectClass called with pending exception 'java.lang.NullPointerException' thrown in unknown throw locationF/art     ( 9999): art/runtime/check_jni.cc:65]     in call to GetObjectClassF/art     ( 9999): art/runtime/check_jni.cc:65]     from void org.lamw.lamwguiproject2.Controls.pAppOnCreate(android.content.Co ntext, android.widget.RelativeLayout, android.content.Intent)F/art   ( 9999): art/runtime/check_jni.cc:65] "main" prio=5 tid=1 RunnableF/art     ( 9999): art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x35da4000 self=0x74427800F/art   ( 9999): art/runtime/check_jni.cc:65]   | sysTid=9999 nice=0 cgrp=default sched=0/0 handle=0x77f28460F/art     ( 9999): art/runtime/check_jni.cc:65]   | state=R schedstat=( 96463376 109199391 87 ) utm=8 stm=1 core=0 HZ=100  I'm comparing androidmanifest.xml and styles.xml from a working apk, it looks like the AppCompat them should be used, of course at the moment it doesn't build the apk the battle go forward.... ---------------------------------------------------------------------- jmpessoa · 2017-10-02 00:57 We do not have "AppCompat" [and others 'support" library]   in LAMW....  so, it will fail!!! Stay with LAMW default style e try change minSDK and tarqetSDK in manifest.... ---------------------------------------------------------------------- turronet · 2017-10-04 20:59 Hi Jmpessoa, I found a way to get the Nogui JNI app working, simply in the new project template You left getSum and getString method unimplemented, so I got it work. I discovered this by analyzing the demos. so the toolchain is definitely correct, but still failiing when using GUI. I tried to open and build a demos gui, but I'm getting invalid apk. so .... go forward.... ---------------------------------------------------------------------- jmpessoa · 2017-10-04 21:13 QuoteI tried to open and build a demos gui, but I'm getting invalid apk. No! Please, try first a simple "hello world" .... [like a form and a button ...] Thank you! ---------------------------------------------------------------------- turronet · 2017-10-04 23:10 I hope there were some unimplemented method even in GUI template....it wasn't. Anyway got demo GUI compiled but still fc. Do You know how to debug these apk made by fpc? ---------------------------------------------------------------------- jmpessoa · 2017-10-04 23:48 In Attachment,  there is my first and incomplete mips project... but there is a "libcontrols.so"  by my experimental  mips cross- compile. Can you complete [build apk] and test/run it ? Thank you! [EDITED] apk [download] link: https://od.lk/d/Ml8xNDczMDExMTRf/LamwGUIProjectMips1-debug.apk ---------------------------------------------------------------------- turronet · 2017-10-05 10:10 Many Thanks Jose! still crash  did You use win fpc 3.0? 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 I/ActivityManager(  386): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.lamw.lamwguiprojectmips1/.App} from uid 1000 on display 0V/WindowManager(  386): addAppToken: AppWindowToken{13a74407 token=Token{33f6ea46 ActivityRecord{6865621 u0 org.lamw.lamwguiprojectmips1/.App t1179}}} to stack=1 task=1179 at 0I/HmHomeView(  504): onPauseI/art     (15351): Late-enabling -Xcheck:jniI/ActivityManager(  386): Start proc 15351:org.lamw.lamwguiprojectmips1/u0a117 for activity org.lamw.lamwguiprojectmips1/.AppI/HmLauncher-Test(  504): Set prop under watch face page. 0I/art     (  504): Background partial concurrent mark sweep GC freed 8218(438KB) AllocSpace objects, 36(2MB) LOS objects, 9% free, 19MB/21MB, paused 42.112ms total 496.466msW/linker  (15351): libcontrols.so has text relocations. This is wasting memory and prevents security hardening. Please fix.W/art   (15351): Can't call EnsureArtActionInFrontOfSignalChain due to unitialized fault managerF/libc    (15351): Fatal signal 10 (SIGBUS), code 128, fault addr 0x0 in tid 15351 (guiprojectmips1)I/DEBUG   (   91): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***I/DEBUG   (   91): Build fingerprint: 'Huami/huanghe/watch:5.1/PACEfied/28:user/release-keys'I/DEBUG   (   91): Revision: '00000001'I/DEBUG   (   91): ABI: 'mips'I/DEBUG   (   91): pid: 15351, tid: 15351, name: guiprojectmips1  >>> org.lamw.lamwguiprojectmips1 <<