Recent

Author Topic: Can't build the Android example project, can't run app  (Read 4291 times)

speller

  • Newbie
  • Posts: 6
Can't build the Android example project, can't run app
« on: March 12, 2017, 06:56:12 pm »
Hi,
I'm totally newbie to FPC and Lazarus. I'm trying to build an android app. And I fail even with the androidlcl example...
I installed the customdrawn extension to the IDE, opened the androidlcl example selected the Release-TAndroid build mode, pressed Shift+F9 and got this error:

Quote
Compiling LCL 1.6.4: exit code 1, errors: 1
gtk2cellrenderer.pas(30,3) Fatal: Can't find gtk2, used in Gtk2CellRenderer of package LCL.

(translated it from my localizaed version to English)

What I do wrong?

I successfully installed the FPC with Android-Arm cross compiler. If I create new empty project and set the project settings to build android-arm, I get successfully compiled app, I then can create apk with the laztoapk, and even can install it to the real device. But when I try to run it on the device I just get the error "Application Project1 was stopped".

Could you please assist what I do wrong?


Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Can't build the Android example project, can't run app
« Reply #2 on: March 12, 2017, 08:39:20 pm »
"Application Project1 was stopped".
Could you please assist what I do wrong?

If I remember correctly, this bug already reported perhaps a year ago. This bug happens on devices with Android version 5 and above. Did you use Android version 5? Several Android related bugs has been fixed. You may have better luck if you use FPC 3.0.2, which just releases some weeks ago.

speller

  • Newbie
  • Posts: 6
Re: Can't build the Android example project, can't run app
« Reply #3 on: March 13, 2017, 03:34:55 am »

If I remember correctly, this bug already reported perhaps a year ago. This bug happens on devices with Android version 5 and above. Did you use Android version 5? Several Android related bugs has been fixed. You may have better luck if you use FPC 3.0.2, which just releases some weeks ago.

Yes, I'm using Android 6. FPC version is 3.0.2.

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Can't build the Android example project, can't run app
« Reply #4 on: March 13, 2017, 04:15:09 am »
If that's so, it means the bug still hasn't fixed. You may try to run it on Android 4 devices.

Alternatively, you can try other ways to build Android applications using Lazarus. From my tests, I think LAMW is the best, it has lots of features and actively developed and maintained.

Here is the list of Android application development ways of using Lazarus/FPC I ever know:
http://forum.lazarus.freepascal.org/index.php/topic,33487.msg217112.html#msg217112

FPC JVM seems to have good potential. Someone is regularly posting his progress using Pandroid module in this threads:
http://forum.lazarus.freepascal.org/index.php/board,56.0.html

speller

  • Newbie
  • Posts: 6
Re: Can't build the Android example project, can't run app
« Reply #5 on: March 13, 2017, 06:27:49 am »
see this
http://forum.lazarus.freepascal.org/index.php/topic,35601.msg236678.html#msg236678

I rebuilt the IDE but without success, the error still exists. I'm wandered having troubles compiling example project...

Handoko

  • Hero Member
  • *****
  • Posts: 5154
  • My goal: build my own game engine using Lazarus
Re: Can't build the Android example project, can't run app
« Reply #6 on: March 13, 2017, 09:38:26 am »
Have you tried to compile nonandroidtest.lpi?

Me too failed to compile androidlcltest.lpi but I am able to compile nonandroidtest.lpi.

 

TinyPortal © 2005-2018