Recent

Author Topic: lcl example crashes  (Read 7943 times)

tanakian

  • New member
  • *
  • Posts: 9
lcl example crashes
« on: December 15, 2014, 02:10:12 pm »
let me explain what i did

symlinks for fpc. tried both 4.8 and 4.6 versions.
Quote
sudo ln -s /opt/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld.bfd /usr/bin/arm-android-ld
sudo ln -s /opt/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-as /usr/bin/arm-android-as

compiled x86_64 and arm versions of git fpc.
Quote
git clone https://github.com/graemeg/freepascal.git

Quote
PRF="/opt"
FPC="fpc"
VER="2.7.1"
cd freepascal
make all INSTALL_PREFIX=$PRF/$FPC
make crossall OS_TARGET=android CPU_TARGET=arm CROSSOPT='-CpARMv5'  INSTALL_PREFIX=$OPT/$FPC

Quote
cd freepascal
make install INSTALL_PREFIX=/opt/fpc
make crossinstall OS_TARGET=android CPU_TARGET=arm CROSSOPT='-CpARMv5' INSTALL_PREFIX=/opt/fpc

Quote
ln -s /opt/fpc/lib/fpc/2.7.1/ppcrossarm /opt/fpc/lib/fpc/2.7.1/ppcarm

Quote
/opt/fpc/bin/fpcmkcfg -d basepath=/opt/fpc/lib/fpc/2.7.1 -o /etc/fpc.cfg

tested
Quote
export PATH=/opt/fpc/lib/fpc/2.7.1:$PATH
/opt/fpc/bin/fpc -Parm -Tandroid

now lazarus
Quote
git clone https://github.com/graemeg/lazarus
export PATH="/opt/fpc/bin:/opt/fpc/lib/fpc/2.7.1:$PATH"
cd lazarus
make

lcl test did not pass "ant debug" stage.
for that i have edited files:

local.properties looks:
Quote
#sdk.dir=/home/felipe/Programas/android-sdk-linux
sdk.dir=/opt/android-sdk-update-manager

default.properties:
Quote
target=android-18

i have tried different targets.

so now i can build apk, but it always crashes both on real device and emulator with android 4 version.

i have rebuilt fpc and lazarus several times for armv5 and armv6 but it does not help actually.

even just pressing a button crashes the application.

i have removed everything from lcl test and left only one button but it does crash on click too.
even if there is no event assigned.
« Last Edit: December 15, 2014, 02:12:14 pm by tanakian »

tanakian

  • New member
  • *
  • Posts: 9
Re: lcl example crashes
« Reply #1 on: December 15, 2014, 02:15:46 pm »
android ndk version 10b, lazarus and fpc - git versions, always crash. one week ago, now.

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 255
    • Fresh sound.
Re: lcl example crashes
« Reply #2 on: December 16, 2014, 04:40:26 am »
If you are on windows then ry laztoapk and let us know if it works. The wiki at laztoapk on sourceforge contains a table with comfigurations that worked.
Linux Mint 20.3, Lazarus 2.3, Windows 10, Delphi 10.3 Rio, Delphi 11.1 Alexandria

tanakian

  • New member
  • *
  • Posts: 9
Re: lcl example crashes
« Reply #3 on: December 16, 2014, 10:17:17 am »
no i am not on windows.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: lcl example crashes
« Reply #4 on: December 16, 2014, 10:43:59 am »
I have neither ARMv5 nor ARMv6 devices so I can't tell. But my apps compiled for ARMv7a works just fine, both emulator and real device. I have to use 4.6 version of the toolchain, though.

tanakian

  • New member
  • *
  • Posts: 9
Re: lcl example crashes
« Reply #5 on: December 17, 2014, 12:24:02 pm »
I'll try to use armv7a backend and 4.6 toolkit, thank you.

which API version do you use?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: lcl example crashes
« Reply #6 on: December 17, 2014, 02:09:03 pm »
I'll try to use armv7a backend and 4.6 toolkit, thank you.

which API version do you use?
14 for both target and min SDK

tanakian

  • New member
  • *
  • Posts: 9
Re: lcl example crashes
« Reply #7 on: December 20, 2014, 04:37:28 pm »
with 14 it does not even run.
with api 8 it runs but crashes like with api 18.

now tested with fpc for armv7a. 4.6 tools.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: lcl example crashes
« Reply #8 on: December 20, 2014, 07:17:26 pm »
with 14 it does not even run.
with api 8 it runs but crashes like with api 18.

now tested with fpc for armv7a. 4.6 tools.
Wait, are you using LCL Custom Drawn? I haven't used it for a long time. My statement above applies to LazAndroidModuleWizard generated apps.

tanakian

  • New member
  • *
  • Posts: 9
Re: lcl example crashes
« Reply #9 on: December 22, 2014, 08:15:49 am »
yes, there is a custom drawn lcl example. i am trying to compile it.

tanakian

  • New member
  • *
  • Posts: 9
Re: lcl example crashes
« Reply #10 on: December 22, 2014, 08:27:52 am »
i have tried to comple lazandroidmodulewizard minute ago.

it fails with "character.pas(29,3) Fatal: Cannot find unit unicodedata used by character."

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11352
  • FPC developer.
Re: lcl example crashes
« Reply #11 on: December 22, 2014, 12:11:21 pm »
The makefile of linux looks very different from target android. It looks like that hasn't been run in an year or so.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: lcl example crashes
« Reply #12 on: December 22, 2014, 12:36:08 pm »
i have tried to comple lazandroidmodulewizard minute ago.

it fails with "character.pas(29,3) Fatal: Cannot find unit unicodedata used by character."
There's no such a unit here. What LazAndroidModuleWizard are you compiling? I just updated it today and it still works like yesterday and months ago. Even the size of the binary has been halved.

tanakian

  • New member
  • *
  • Posts: 9
Re: lcl example crashes
« Reply #13 on: December 22, 2014, 08:49:55 pm »
i have noticed that there is no such a unit. like you i have cloned github version. do you use windows? i am on linux. may be that is the difference.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8744
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: lcl example crashes
« Reply #14 on: December 23, 2014, 02:09:51 am »
i have noticed that there is no such a unit. like you i have cloned github version. do you use windows? i am on linux. may be that is the difference.
no, I use linux. and if we pull from the same git repo and branch (should be, there's only 1 branch: master) there won't be any platform difference in source. git simply doesn't know that.

 

TinyPortal © 2005-2018