Recent

Author Topic: What's wrong with my .apk file?  (Read 10917 times)

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 251
    • Fresh sound.
What's wrong with my .apk file?
« on: August 25, 2013, 07:54:28 am »
Hi,

I am able now to compile/build an .apk.

When I run it in the emulator or on a real device, the app just crashes.
I attached the adb.txt but don't see the problem.
Could someone have a look at the adb.txt and give me a hint?

Thanks.
Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

truetom

  • Jr. Member
  • **
  • Posts: 72
    • http://sourceforge.net/projects/laz4android/
Re: What's wrong with my .apk file?
« Reply #1 on: August 25, 2013, 09:48:22 am »
Hello DelphiFreak.
I have seen the  adb.txt .I guess the question is package name is wrong,but I not sure.If you agree ,you can send the project to me,maybe I can debug it.

Greetings!
laz4android : a Lazarus for Android Package.
http://sourceforge.net/projects/laz4android/

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 251
    • Fresh sound.
Re: What's wrong with my .apk file?
« Reply #2 on: August 25, 2013, 11:35:27 am »
Thanks for your answer.

Here is a whole project.

Attention. It's now called "project4". (does not correspond with the previous abd.log)

The generate apk-file is in folder \project4\android\bin\

https://dl.dropboxusercontent.com/u/3753548/project4.7z

Thank you.

Sam

Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

truetom

  • Jr. Member
  • **
  • Posts: 72
    • http://sourceforge.net/projects/laz4android/
Re: What's wrong with my .apk file?
« Reply #3 on: August 25, 2013, 04:58:29 pm »
Hello DelphiFreak.I haved debug the project4.Now it's running OK!
You can download from here:http://sdrv.ms/17cIBrJ,please select project4.7z.
Also you can find the apk-file in \project4\android\bin\project4.apk.
changed  list:
1.project options-> other add this:-dANDROID -Xd -CpARMV6

2.project options->Paths->Libraries change to Android NDK r7.
  android-ndk-r7\platforms\android-8\arch-arm\usr\lib\;
  android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\lib\gcc\arm-linux-androideabi\4.4.3\

3.AndroidManifest.xml line 3:
  package="com.pascal.project4"

4.Add two files: one is generate_debug_key2.bat,this batch file is create a debug key.The two is build_debug_apk2.bat , this file is build apk file.

Now the project4.apk is running in my Lenovo LePad A1-07 OK.It's Android 2.3.3.
I'm used laz4android-41139-FPC2.7.1 + windows xp sp3 +  android NDK r7 to build this Project.

sorry my bad english!
Greetings!
laz4android : a Lazarus for Android Package.
http://sourceforge.net/projects/laz4android/

Leledumbo

  • Hero Member
  • *****
  • Posts: 8242
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: What's wrong with my .apk file?
« Reply #4 on: August 25, 2013, 08:14:49 pm »
Indeed it's the package name:
Quote
line 1213: W/PackageManager(  864): Package named 'com.pascal.project3' doesn't exist.
Quote
line 1357: E/AndroidRuntime( 1494): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{COM.PASCAL.LCLTEST/COM.PASCAL.LCLTEST.LCLActivity}: java.lang.ClassNotFoundException: COM.PASCAL.LCLTEST.LCLActivity

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 251
    • Fresh sound.
Re: What's wrong with my .apk file?
« Reply #5 on: August 26, 2013, 07:27:13 am »
Hello truetom,

thank you very very much.
I can run the apk you have built. It runs fine on my tablet with Android 4.0.3

I am working on this little tool: ApkManager
http://sourceforge.net/projects/laztoapk/

As you can see from the newsgroup, a lot of people have problems to build a working lazarus app for android.
Mostly because of this ugly dependencies to SDK,NDK,Java.

With ApkManager I try to make things easier for everyone. (it's not ready yet to distribute an .exe, but sources are available).

Thanks also to leledumbo for his longtime help in this news group.

Regards,
Sam

During development, I found a problem in FPC 2.7.1 http://bugs.freepascal.org/view.php?id=24853

 But no one seems to be interested in this issue. :(


Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

zariq

  • Full Member
  • ***
  • Posts: 109
Re: What's wrong with my .apk file?
« Reply #6 on: August 26, 2013, 05:30:15 pm »

I am working on this little tool: ApkManager


Hi.
I downloaded one of your first versions and made some minor changes to allow different folder, app and package names, and relative paths. It makes things a lot easier. Haven't had any success downloading it from sourceforge.

Regarding the bug, I downloaded the package by truetom which is  41139, and it is fine on that.

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 251
    • Fresh sound.
Re: What's wrong with my .apk file?
« Reply #7 on: August 27, 2013, 09:50:17 pm »
Still in trouble.

The application show's now up in the emulator (also on my real tablet) but crashes when clicking on a button.

The offical location of project laztoapk at sourceforge:
http://sourceforge.net/projects/laztoapk/

The complete project laztoapk (Version alpha 0.10) with sources and compiled .exe-file.
https://dl.dropboxusercontent.com/u/3753548/laztoapk_source_and_exe_alpha_0_10.7z

the exe-file only.
https://dl.dropboxusercontent.com/u/3753548/laztoapk_exe_alpha_0_10.7z

My created project4 ( which still does not work  :o ) ( somehow the liblclapp.so  is only 2 MBytes while the file from truetom has 4 MBytes)
https://dl.dropboxusercontent.com/u/3753548/project4.7z

The adb log of my crashing project4.
https://dl.dropboxusercontent.com/u/3753548/project4.log

I am using

Typhon 4.4 r42002 FPC 2.7.1 i386-win32-win32/win64

Free Pascal Compiler version 2.7.1 [2013/08/15] for arm
Copyright (c) 1993-2013 by Florian Klaempfl and others
C:\codetyphon\fpc\bin\i386-win32\ppcrossarm.exe
Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

truetom

  • Jr. Member
  • **
  • Posts: 72
    • http://sourceforge.net/projects/laz4android/
Re: What's wrong with my .apk file?
« Reply #8 on: August 28, 2013, 04:13:58 am »
Hello DelphiFreak.
I have not used CodeTyphon,so I don't know what's happening.
I suggest that you try to use my laz4android-41139-FPC2.7.1 package to test it.
You can download here:http://sdrv.ms/12cHbIZ.
At least I can compiled it and runs fine.
laz4android : a Lazarus for Android Package.
http://sourceforge.net/projects/laz4android/

zariq

  • Full Member
  • ***
  • Posts: 109
Re: What's wrong with my .apk file?
« Reply #9 on: August 28, 2013, 07:55:52 am »
For me having targetsdkversion=14 in androidmanifest crashes on startup but targetsdkversion=8 works fine. having 14 in other files does doesn't affect it.

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 251
    • Fresh sound.
Re: What's wrong with my .apk file?
« Reply #10 on: August 31, 2013, 02:59:54 pm »
Hello TrueTom,

I have downloaded your "laz4android" package as you suggested and extracted to a folder.

But I could not find the tool "lazbuild.exe" or "typhonbuild.exe" or any similar.

My laztoapk tool creates a build-batch like this

c:\codetyphon\typhon\bin32\typhonbuild.exe "C:\LProjects\project4\project4android.lpi"
pause

What's the equivalent in your package?

Thank you.
Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

jmpessoa

  • Hero Member
  • *****
  • Posts: 1526
Re: What's wrong with my .apk file?
« Reply #11 on: August 31, 2013, 03:11:52 pm »
First:

Configure (SET FPC_BIN_PATH=F:\laz4android) e run "build.bat"...

Greetings!

« Last Edit: August 31, 2013, 03:31:37 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 251
    • Fresh sound.
Re: What's wrong with my .apk file?
« Reply #12 on: September 01, 2013, 06:12:57 pm »
Thanks, that worked fine.

After that I called my batch file.

C:\temp\laz4android\lazbuild.exe "C:\LProjects\project4\project4android.lpi"

This results in the following error

C:\temp\laz4android\fpc\2.7.1\bin\i386-win32\arm-linux-androideabi-ld.exe: E:\an
droid\ndk\platforms\android-8\arch-arm\usr\lib\crtend_so.o: Unknown mandatory EA
BI object attribute 44


I tried  arm-linux-androideabi-4.6 and arm-linux-androideabi-4.8 with the same result.

As I can see from the example of truetom, he used version 4.4.3.

But 4.4.3 is not installed on my machine. Where to get that version from?
It's a real nightmare to configure this tool-chain.

Thank you for your help.





Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

jmpessoa

  • Hero Member
  • *****
  • Posts: 1526
Re: What's wrong with my .apk file?
« Reply #13 on: September 02, 2013, 06:42:35 am »

Try just NDK 7....

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

DelphiFreak

  • Sr. Member
  • ****
  • Posts: 251
    • Fresh sound.
Re: What's wrong with my .apk file?
« Reply #14 on: September 04, 2013, 06:43:46 am »
Yes, finally after installing ndk-r7c it works.  :D

http://dl.google.com/android/ndk/android-ndk-r7c-windows.zip
Linux Mint 19.1, Lazarus 2.0, Windows 7&10, Delphi 7, Delphi 10.3 Rio

 

TinyPortal © 2005-2018