Recent

Author Topic: First steps of LCL-Android are ready  (Read 119376 times)

Jonathan

  • New Member
  • *
  • Posts: 40
Re: First steps of LCL-Android are ready
« Reply #30 on: August 25, 2011, 10:50:40 am »
Hi felipemdc ,the "libandroidlcltest.so" doesnt exist but libandroidlcltest.so  the result is :/home/hotcyy/lazarus-ccr/examples/androidlcl/android/libs/armeabi/libandroidlcltest.so: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped.
 

Do you have a clue? Thanks

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: First steps of LCL-Android are ready
« Reply #31 on: August 25, 2011, 11:30:46 am »
Well, it is obviously compiled for the wrong architecture, maybe even wrong widgetset.

Which build mode are you using? Are you using Lazarus from subversion?

Jonathan

  • New Member
  • *
  • Posts: 40
Re: First steps of LCL-Android are ready
« Reply #32 on: August 25, 2011, 12:11:56 pm »
Well, it is obviously compiled for the wrong architecture, maybe even wrong widgetset.
   Sometimes I also think I compiler for i386-linux not arm-linux . I haved worked out " the turbochessclock4android  " (another example ),so I setup the cross compiler and lazarus as the same but it doesnt work this time ! How to  know the APK for i386-linux or arm-linux?
  widgetset  I choose gtk2 :Tools/Configure Build Lazarus  and Projec Options/Comlier Options/Build Modes/Set macro values..

Which build mode are you using? Are you using Lazarus from subversion?
   Projec Options/Comlier Options/Build Modes : The Active checkbox  of android is True .Is it Right? 
  Yes I use the lastest subversion lazarus 0.9.31 .What is More:A few days ago ,I use lazarus 0.9.30 ,finally I got the APK(It is 1.9M and It can not work too)。
« Last Edit: August 25, 2011, 12:18:23 pm by Jonathan »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: First steps of LCL-Android are ready
« Reply #33 on: August 25, 2011, 12:16:56 pm »
   Sometimes I also think I compiler for i386-linux not arm-linux . I haved worked out " the turbochessclock4android  " (another example ),so I setup the cross compiler and lazarus as the same but it doesnt work this time ! How to  know the APK for i386-linux or arm-linux?

Use the file command as previously. The result of the file command that you posted clearly shows that the binary is for x86

You can also try this:

ldd libsomething.so

If it uses any gtk lib then it isn't even compiled for the android widgetset.

Quote
   Projec Options/Comlier Options/Build Modes : The Active checkbox  of android is True .Is it Right? 
  Yes I use the lastest subversion lazarus 0.9.31 .What is More:A few days ago ,I use lazarus 0.9.30 ,finally I got the APK(It is 1.9M and It can not work too)。

And what is configured for widgetset? And for architecture? And for operating system? Maybe post some screenshots of your project options dialog?

Jonathan

  • New Member
  • *
  • Posts: 40
Re: First steps of LCL-Android are ready
« Reply #34 on: August 25, 2011, 12:31:35 pm »
felipemdc
The screenshots of my project options : 1 Build Modes   2 Code Generation
« Last Edit: August 25, 2011, 12:33:16 pm by Jonathan »

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: First steps of LCL-Android are ready
« Reply #35 on: August 25, 2011, 12:34:14 pm »
Hi Felipe,
I have completed compiling androidlcl, but encountered with this error when I have done ant debug.

Buildfile: /home/indianajones/android/androidlcl/android/build.xml

BUILD FAILED
/home/indianajones/android/androidlcl/android/build.xml:46: taskdef class com.android.ant.SetupTask cannot be found
 using the classloader AntClassLoader[]

Total time: 2 seconds

Any idea?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: First steps of LCL-Android are ready
« Reply #36 on: August 25, 2011, 12:52:19 pm »
BUILD FAILED
/home/indianajones/android/androidlcl/android/build.xml:46: taskdef class com.android.ant.SetupTask cannot be found
 using the classloader AntClassLoader[]

This is not really an error while building the project, but rather a missing part of the ant installation. Are you using Linux or Mac OS X?

I installed a huge amount of java packages in my distro until it finally worked, so I no longer remember what is really required. If you are using linux, search for any packages with ant, or with setuptask and try to install them. I am sure that if you install enough packages it will eventually work.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: First steps of LCL-Android are ready
« Reply #37 on: August 25, 2011, 12:56:03 pm »
felipemdc
The screenshots of my project options : 1 Build Modes   2 Code Generation

Well, they are clearly wrong. In the first screenshot change the widgetset to Android. Not just the build mode, but the widgetset too.

In the second screenshot set the target CPU to ARM

Set the operating system to Linux.

Strange that all those configurations are wrong.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: First steps of LCL-Android are ready
« Reply #38 on: August 25, 2011, 12:57:39 pm »
This is not really an error while building the project, but rather a missing part of the ant installation. Are you using Linux or Mac OS X?

I installed a huge amount of java packages in my distro until it finally worked, so I no longer remember what is really required. If you are using linux, search for any packages with ant, or with setuptask and try to install them. I am sure that if you install enough packages it will eventually work.

Another idea I just had: Maybe you don't have the Android SDK installed? You need to install it and set the path to it in the files under androidlcl/android/* (check all files, one of them has the sdk path)

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: First steps of LCL-Android are ready
« Reply #39 on: August 25, 2011, 02:23:49 pm »

It seems that just ant package and sun-java6-jdk are fine for compilation instead I use Debian based distribution.
Here is the solution, I have found in this web page.
http://code.google.com/p/android/issues/detail?id=14773
when I have done $SDK/tools/android update project -p /path/to/project everything is fine now.
But another question is, in the bin directory there are two apk files which are AndroidLCLTest-debug.apk and AndroidLCLTest-debug-unaligned.apk
which one I am going to use?
PS. ant version is 1.8.2

Thanks.



felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: First steps of LCL-Android are ready
« Reply #40 on: August 25, 2011, 02:31:24 pm »
Use only AndroidLCLTest-debug.apk

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: First steps of LCL-Android are ready
« Reply #41 on: August 25, 2011, 02:42:11 pm »

Felipe, I use and install both of them, but I see just a blank black window and it exists eventually.  %)
Here are some details.
Android version 2.3.4
Google Nexus one.
Thanks.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: First steps of LCL-Android are ready
« Reply #42 on: August 25, 2011, 03:32:12 pm »
What does your logcat say?

./adb logcat

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
Re: First steps of LCL-Android are ready
« Reply #43 on: August 25, 2011, 05:20:15 pm »

Here is the log when I execute the app.

I/power   (   92): *** set_screen_state 1
D/SurfaceFlinger(   92): Screen about to return, flinger = 0x8e078
D/AK8973  (   73): Compass Start
D/VoldCmdListener(   63): volume shared /mnt/sdcard ums
I/ActivityManager(   92): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/com.android.launcher2.Launcher } from pid 92
V/RenderScript_jni(  174): surfaceCreated
V/RenderScript_jni(  174): surfaceChanged
I/ActivityManager(   92): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.pascal.androidlcl/.AndroidLCLTest } from pid 174
I/ActivityManager(   92): Start proc com.pascal.androidlcl for activity com.pascal.androidlcl/.AndroidLCLTest: pid=14567 uid=10072 gids={}
V/AndroidPipesComm:(14567): Executing application /data/data/com.pascal.androidlcl/lib/libandroidlcltest.so copied to /data/data/com.pascal.androidlcl/files/androidlcltest
V/RenderScript_jni(  174): surfaceDestroyed
V/AndroidPipesComm:(14567): WaitForPascalMessage(amkActivityCallback, ams_ActivityCallback_onCreateFinished)
V/AndroidPipesComm:(14567): START WaitForPascalMessage AExpectedMessageType=0 AExpectedMessageSubtype=1001
V/AndroidPipesComm:(14567): [WaitAndProcessPascalMessage] EOFException=null
I/ActivityManager(   92): Process com.pascal.androidlcl (pid 14567) has died.
V/RenderScript_jni(  174): surfaceCreated
V/RenderScript_jni(  174): surfaceChanged
W/InputManagerService(   92): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@406b4490

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: First steps of LCL-Android are ready
« Reply #44 on: August 25, 2011, 07:37:06 pm »
Could you give me some info about your pascal executable? For example:

cd libs/armeabi
ls -l
file libandroidlcltest.so
ldd libandroidlcltest.so

And post all results here.

Did you include debug info in the executable? I remember that if you put Debug info it might get too heavy to run.

Do you have any other device to test?

 

TinyPortal © 2005-2018