Recent

Author Topic: LAMW App Crashes on Start up  (Read 12850 times)

Warfley

  • Sr. Member
  • ****
  • Posts: 309
LAMW App Crashes on Start up
« on: July 22, 2016, 04:12:14 pm »
Hey guys, i have a problem using LAMW to build and run an APK on an Android AVD.

So basically what im doing is this: Create new LAMW project, NDK 11c, SDK version 21, architecture x86 (like my AVD) then i build the empty app and run it (with some controls, a button and an edit). Everything works perfectly well. Then i change something (in this particular case i added a location component). Try to build and run again, the app crashes with the messagebox "unfortunately the app has stopped". Then i undo the changes I made to the point it had run in first place, try to build and run again, still crashing with this error.

These are some parts of the ADB log, i think might be about the problem (i'm not so much into android, just pressed ctrl+f and searched for error):
Quote
I/DEBUG   ( 1131): pid: 2246, tid: 2246, name: lamwguiproject2  >>> org.lamw.lamwguiproject2 <<<
I/DEBUG   ( 1131): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/DEBUG   ( 1131): Abort message: 'art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodA called with pending exception 'java.lang.NoSuchMethodError' thrown in void org.lamw.lamwguiproject2.Controls.pAppOnCreate(android.content.Context, android.widget.RelativeLayout):-2'
I/DEBUG   ( 1131):     eax 00000000  ebx 000008c6  ecx 000008c6  edx 00000006
I/DEBUG   ( 1131):     esi b779ff08  edi 0000000b
I/DEBUG   ( 1131):     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000007  xss 0000007b
I/DEBUG   ( 1131):     eip b770c456  ebp 000008c6  esp bf8a32f0  flags 00200282
I/DEBUG   ( 1131):
I/DEBUG   ( 1131): backtrace:
I/DEBUG   ( 1131):     #00 pc 00075456  /system/lib/libc.so (tgkill+22)
I/DEBUG   ( 1131):     #01 pc 00021b1b  /system/lib/libc.so (pthread_kill+155)
I/DEBUG   ( 1131):     #02 pc 00023394  /system/lib/libc.so (raise+36)
I/DEBUG   ( 1131):     #03 pc 0001b874  /system/lib/libc.so (abort+84)
I/DEBUG   ( 1131):     #04 pc 003735e6  /system/lib/libart.so (art::Runtime::Abort()+294)
I/DEBUG   ( 1131):     #05 pc 000ec304  /system/lib/libart.so (art::LogMessage::~LogMessage()+1668)
I/DEBUG   ( 1131):     #06 pc 00101598  /system/lib/libart.so (art::JniAbort(char const*, char const*)+1656)
I/DEBUG   ( 1131):     #07 pc 00101ecc  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+108)
I/DEBUG   ( 1131):     #08 pc 00107ffb  /system/lib/libart.so (art::ScopedCheck::CheckThread(int)+3147)
I/DEBUG   ( 1131):     #09 pc 00108972  /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+322)
I/DEBUG   ( 1131):     #10 pc 0011455b  /system/lib/libart.so (art::CheckJNI::CallObjectMethodA(_JNIEnv*, _jobject*, _jmethodID*, jvalue*)+59)
I/DEBUG   ( 1131):     #11 pc 00032e93  /data/app/org.lamw.lamwguiproject2-2/lib/x86/libcontrols.so
I/DEBUG   ( 1131):     #12 pc 00040d48  /data/app/org.lamw.lamwguiproject2-2/lib/x86/libcontrols.so
I/DEBUG   ( 1131):     #13 pc 0003aec4  /data/app/org.lamw.lamwguiproject2-2/lib/x86/libcontrols.so
I/DEBUG   ( 1131):     #14 pc 000106d5  /data/app/org.lamw.lamwguiproject2-2/lib/x86/libcontrols.so
I/DEBUG   ( 1131):     #15 pc 0006ad4b  /data/dalvik-cache/x86/data@app@org.lamw.lamwguiproject2-2@base.apk@classes.dex
I/DEBUG   ( 1131):
I/DEBUG   ( 1131): Tombstone written to: /data/tombstones/tombstone_06I/BootReceiver( 1470): Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
E/SharedPreferencesImpl( 1470): Couldn't create directory for SharedPreferences file shared_prefs/log_files.xml
I/Zygote  ( 1138): Process 2246 exited due to signal (6)
W/libprocessgroup( 1470): failed to open /acct/uid_10056/pid_2246/cgroup.procs: No such file or directory
I/ActivityManager( 1470): Process org.lamw.lamwguiproject2 (pid 2246) has died

The whole log and the project is added as attachment to this post.

What am i doing wrong? I have no Idea.

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW App Crashes on Start up
« Reply #1 on: July 22, 2016, 06:38:18 pm »
Hello Warfley!

Please, try:

1. Close and re-open your project again ...

2. Check this path [project.lpi], it exists in your system?

Quote
C:\Developer\Android\ndk\android-ndk-r11c\toolchains\x86-4.9\prebuilt\lib\gcc\i686-android-linux\4.9\

3. Doing a new project the problem continue?

4. Check your AVD CPU/ABI ...... [my is ARM, so I dont get to test for x86!]

EDITED: here in "project.lpi" we can note that the path

C:\Developer\Android\ndk\android-ndk-r11c\toolchains\x86-4.9\prebuilt\\bin

is incomplete .... after prebuild "windows" was missing...

« Last Edit: July 22, 2016, 07:19:05 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Warfley

  • Sr. Member
  • ****
  • Posts: 309
Re: LAMW App Crashes on Start up
« Reply #2 on: July 23, 2016, 12:58:01 am »
Thank you for your quick answer.

I don't know how the part of this path got lost (i haven't changed anything) i will try it when i am back home. But i had the same issue with some other projects, it works once and then no more, and i haven't changed anything on the path, could this be a bug?

And second of all, currently im not at home, but i tried to run lamw on my macbook. As it works fine with Linux, and the Crosscompilers, ndk, sdk and ant are working fine with OS X, so i thought ill give it a trail. But i found a huge problem with it, i could install the packages, but when i try to enter the path config window (Tools->[LAMW] ... -> ...), it crashes. Is there any possibility to fill the data by hand (in a config file or something)? I'd like to check out if it works with OS X too.

Edit: Solved the OS X problem by replacing the RadioGroup with a Combobox. But with OS X it also cut's the Path off (New Project -> JNI GUI, then Project Settings->Paths the i386-darwin is missing), so it seems that this might be a bug within LAMW
« Last Edit: July 23, 2016, 02:52:53 am by Warfley »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW App Crashes on Start up
« Reply #3 on: July 23, 2016, 03:35:39 am »

Hi Warfley!

1. You can get the config file "JNIAndroidProject.ini"  in "Lazarus\config\" folder...

2. Please, on  windows,  try  an "ARM" project , so we can see if  it also cut the project path ...  [LAMW BUG?]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Warfley

  • Sr. Member
  • ****
  • Posts: 309
Re: LAMW App Crashes on Start up
« Reply #4 on: July 25, 2016, 01:59:07 pm »
So first of all, im back on my windows PC, and tried to fix the Path, it worked fine (for now).

But the path gets also cut of with an armv6 and armv7 + VFPv3 project

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW App Crashes on Start up
« Reply #5 on: July 25, 2016, 07:05:49 pm »


Hi Warfley,

Please, put here your  "JNIAndroidProject.ini"  from  "Lazarus\config\" folder...
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Warfley

  • Sr. Member
  • ****
  • Posts: 309
Re: LAMW App Crashes on Start up
« Reply #6 on: July 26, 2016, 01:30:19 am »
Code: Pascal  [Select][+][-]
  1. [NewProject]
  2. PathToNdkPlataforms=C:\Developer\Android\ndk\android-ndk-r11c
  3. PathToJavaTemplates=C:\Developer\Android\lazandroidmodulewizard\java
  4. PathToJavaJDK=C:\Program Files\Java\jdk1.8.0_101
  5. PathToAndroidNDK=C:\Developer\Android\ndk\android-ndk-r11c
  6. PathToAndroidSDK=C:\Developer\Android\AndroidSDK
  7. PathToAntBin=C:\Developer\Android\apache-ant-1.9.7\bin
  8. NDK=4
  9. PathToWorkspace=C:\Developer\Android\Projects
  10. FullProjectName=
  11. InstructionSet=0
  12. ProjectModel=1
  13. AntPackageName=org.lamw
  14. AndroidPlatform=6
  15. MinApi=8
  16. TargetApi=0
  17. AntBuildMode=debug
  18. MainActivity=App
  19. SupportV4=yes
  20. PrebuildOSYS=
Well i guess its a problem that PrebuildOSYS is empty

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW App Crashes on Start up
« Reply #7 on: July 26, 2016, 02:56:12 am »
Yes,

PrebuildOSYS empty is a LAMW BUG [I will try fix it!]!

Please, set  PrebuildOSYS  according to your system:

PrebuildOSYS=windows
or
PrebuildOSYS=windows-x86_64
or
PrebuildOSYS=linux-x86_32
or
PrebuildOSYS=linux-x86_64
or
PrebuildOSYS=darwin-x86_64
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

CC

  • Full Member
  • ***
  • Posts: 138
Re: LAMW App Crashes on Start up
« Reply #8 on: September 18, 2017, 11:33:42 pm »
Hi,

LAMW looks very promising, great work!

I wanted to see how the demos work, but there is a problem which occurs with even the simplest project. The app crashes right after starting. This is the relevant part of the logcat dump:

W/PGMiddleWare( 3986): in handleAction, invoke client = com.huawei.pgmng.middleware.AudioEffectLowPowerImpl@1a140eae, action = com.huawei.pgmng.PGAction@260af53 actionId =10010 pkg =com.huawei.android.launcher extend1 =179 extend2 = flag =3 type =1

W/OpenGLRenderer( 4104): Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...

Versions :

Windows 7 prof

CodeTyphon 6.20 32bit
FreePascal 3.1.1  Source 11-08-2017 SVN Rev 36870
LAMW latest git

jre1.8.0_144 32bit
jdk1.7.0_80 / jdk1.8.0_144 (tried with both) 32bit

android-ndk-r10e-windows-x86
android-sdk  Target: 24,26 (tried with both)
                   Min version: 15
apache-ant-1.10.1

Test device:
Huawei p8 - android 5.01
LG Leon - android 5.01

Is it possible to debug a LAMW app? (The pascal part with Lazarus / Java Part with Eclipse?)
Is there a downloadable APK known to be working I could use to test if this is something Device/Android version specific?
« Last Edit: September 18, 2017, 11:44:03 pm by CC »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW App Crashes on Start up
« Reply #9 on: September 19, 2017, 02:07:12 am »

Hi,  CC

Try:
 
targetSdkVersion = 21

for Android 5.01

[Have you an "android" cross-compile installed?]
« Last Edit: September 19, 2017, 02:13:52 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

CC

  • Full Member
  • ***
  • Posts: 138
Re: LAMW App Crashes on Start up
« Reply #10 on: September 19, 2017, 02:27:00 am »
Hi,

thank you for your answer. Unfortunately the problem remains the same. I have tried API 21 for the minimal version too  with the same result.

API 15 as a target does not compile at all.

Can you recommend the right versions to use for all parts involved?  JRE, JDK, Ant, NDK, SDK (Tools ,... )  ... 

I have installed the Android cross elements. Does not seem to be any problem with building the SO. 


PS: I understand that this is the Lazarus forum and the IDE I am using is fork of Lazarus, but the problem does not seem to be IDE related and this as the only place I can hope to find a solution.
« Last Edit: September 19, 2017, 02:34:53 am by CC »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW App Crashes on Start up
« Reply #11 on: September 19, 2017, 02:31:58 am »


Quote
Can you recommend the right versions to use for all parts involved...

Your "parts" install is OK!

But, about your "cross-compile"?

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

CC

  • Full Member
  • ***
  • Posts: 138
Re: LAMW App Crashes on Start up
« Reply #12 on: September 19, 2017, 02:44:51 am »
I am not sure how to test  if it is ok any other way than building the android app.

There is a file the with the name  "win32-arm-android-readme.txt" in the FPC directory with this text:


Quote
Files in this directory are part of CodeTyphon Studio Toolchains Library.
Build with CodeTyphon Center and GNU Binutils version 2.23.2

For Android NDK r8e GCC 4.7 Windows 32 bits

I assume I should either use these versions, or an other  IDE and build the cross compiler.
« Last Edit: September 19, 2017, 05:10:37 pm by CC »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW App Crashes on Start up
« Reply #13 on: September 19, 2017, 03:01:44 am »

Hi CC,

Please, install  "Laz4android"  [Lazarus + "android-cross-compile" ]

https://sourceforge.net/projects/laz4android/

choice a root directory like "C:\laz4android"  ....


Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

CC

  • Full Member
  • ***
  • Posts: 138
Re: LAMW App Crashes on Start up
« Reply #14 on: September 19, 2017, 03:42:15 am »
This works out of the box.

Thank you very much for your help!

 

TinyPortal © 2005-2018