Recent

Author Topic: [SOLVED] Error Building APK with LAMW/Windows  (Read 8837 times)

tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
[SOLVED] Error Building APK with LAMW/Windows
« on: April 22, 2016, 07:43:01 pm »
Hi

Currently, I'm trying on Windows and installed successfully from HOW_TO_INSTALL_by_Dieselnutjob.pdf
I use the fpc and lazarus versions specified, not stable versions here.

Build looks OK :

Code: Pascal  [Select][+][-]
  1. Compile package FCL 1.0.1: Success
  2. Compile package LazUtils 1.0: Success
  3. Compile package LCLBase 1.5: Success
  4. Compile package tfpandroidbridge_pack 0.0: Success
  5. Compile Project, OS: android, CPU: arm, Target: C:\lamw\projects\LamwGUIProject1\libs\armeabi-v7a\libcontrols.so: Success, Hints: 5
  6. unit1.pas(9,22) Hint: Unit "And_jni" not used in unit1
  7. unit1.pas(9,31) Hint: Unit "And_jni_Bridge" not used in unit1
  8. unit1.pas(10,5) Hint: Unit "Laz_And_Controls_Events" not used in unit1
  9. controls.lpr(1248,34) Hint: Parameter "reserved" not used
  10. controls.lpr(1264,37) Hint: Parameter "reserved" not used

Except the small difference armeabi changed to armeabi-v7a.

But Build APK doesn't work :

Code: Pascal  [Select][+][-]
  1. Messages, Hints: 2
  2. Note: Duplicate unit "controls" in "controls", orphaned ppu "C:\lamw\projects\LamwGUIProject1\obj\controls\controls.o"
  3. Note: Duplicate unit "controls" in "LCLBase 1.5", ppu="C:\lamw\laz4android\lcl\units\arm-android\controls.ppu", source="C:\lamw\laz4android\lcl\controls.pp"
  4. Building APK... : missing executable "", Errors: 1
  5. Panic: internal error: missing executable ""
  6. Exception, Errors: 1
  7. Fatal: [Exception] Failed: Cannot build APK!

Of course I have checked again all the parameters and paths...

What am I missing ?
What else can I check ?

Thanks







 
« Last Edit: April 25, 2016, 12:05:37 pm by tintinux »
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2330
Re: Error Building APK with LAMW/Windows
« Reply #1 on: April 22, 2016, 08:05:06 pm »

Hello tintnux!

Please, go to your "C:\lazarus\config"  and send me your file: "JNIAndroidProject.ini"

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

tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
Re: Error Building APK with LAMW/Windows
« Reply #2 on: April 23, 2016, 07:55:25 am »
Hi

This is my c:\lamw\laz4Android\JNIAndroidProject.ini file    (I suppose it is the path you want, there is none in c:\lazarus)

Code: Text  [Select][+][-]
  1. [NewProject]
  2. PathToNdkPlataforms=C:\lamw\android-ndk-r10e
  3. PathToJavaTemplates=C:\lamw\trunk\java
  4. PathToJavaJDK=C:\Program Files (x86)\Java\jdk1.8.0_65
  5. PathToAndroidNDK=C:\lamw\android-ndk-r10e
  6. PathToAndroidSDK=C:\lamw\android-sdk-windows
  7. PathToAntBin=C:\lamw\apache-ant-1.9.6-bin
  8. NDK=3
  9. PrebuildOSYS=windows
  10. PathToWorkspace=C:\lamw\projects
  11. FullProjectName=C:\lamw\projects\LamwGUIProject1
  12. InstructionSet=1
  13. FPUSet=0
  14. ProjectModel=1
  15. AntPackageName=org.lamw
  16. AndroidPlatform=3
  17. MinApi=4
  18. TargetApi=0
  19. AntBuildMode=debug
  20. MainActivity=App
  21. SupportV4=no

Thanks for your help
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2330
Re: Error Building APK with LAMW/Windows
« Reply #3 on: April 23, 2016, 06:25:58 pm »

Ok.

Please, try change:

PathToAntBin=C:\lamw\apache-ant-1.9.6-bin

to

PathToAntBin=C:\lamw\apache-ant-1.9.7-bin\apache-ant-1.9.7\bin


[we need de folder "...\bin" to run ant command line tool]

Thank you!





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

tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
Re: Error Building APK with LAMW/Windows
« Reply #4 on: April 23, 2016, 07:49:43 pm »
Hi

According the documentation, I have installed only apache-ant-1.9.6-bin, not 1.9.7

With :
Code: Pascal  [Select][+][-]
  1. PathToAntBin=C:\lamw\apache-ant-1.9.6-bin\apache-ant-1.9.6\bin

It is better, but I have now the following error :
Code: Pascal  [Select][+][-]
  1. Messages, Hints: 2
  2. Note: Duplicate unit "controls" in "controls", orphaned ppu "C:\lamw\projects\LamwGUIProject1\obj\controls\controls.o"
  3. Note: Duplicate unit "controls" in "LCLBase 1.5", ppu="C:\lamw\laz4android\lcl\units\arm-android\controls.ppu", source="C:\lamw\laz4android\lcl\controls.pp"
  4. Building APK... : Exit code 1, Errors: 1
  5. Buildfile: C:\lamw\projects\LamwGUIProject1\build.xml
  6.  
  7. BUILD FAILED
  8. C:\lamw\projects\LamwGUIProject1\build.xml:7: Cannot find C:\lamw\android-sdk-windows\tools\ant\build.xml imported from C:\lamw\projects\LamwGUIProject1\build.xml
  9.  
  10. Total time: 0 seconds
  11. Panic: tool stopped with exit code 1. Use context menu to get more information.
  12. Exception, Errors: 1
  13. Fatal: [Exception] Failed: Cannot build APK!

There is no directory C:\lamw\android-sdk-windows\tools
And Build.xml file are existing only in the projects, demos and example folders.

Thanks again for your help !

Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2330
Re: Error Building APK with LAMW/Windows
« Reply #5 on: April 23, 2016, 08:06:41 pm »
Yes, ant apache 1.9.6 is ok!

About:

Quote
BUILD FAILED

C:\lamw\projects\LamwGUIProject1\build.xml:7:

Cannot find C:\lamw\android-sdk-windows\tools\ant\build.xml

imported from C:\lamw\projects\LamwGUIProject1\build.xml

Your system fail here:

Quote
Cannot find C:\lamw\android-sdk-windows\tools\ant\build.xml

if you do not have this default sdk folders tree : "C:\lamw\android-sdk-windows\tools\ant\"

what sdk you have installed?

Suggestion: delete your sdk folder content and re-install  your sdk!
« Last Edit: April 23, 2016, 08:14:50 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

A.S.

  • Jr. Member
  • **
  • Posts: 76
Re: Error Building APK with LAMW/Windows
« Reply #6 on: April 23, 2016, 09:01:57 pm »
tintinux, you should check if there is "ant.bat" in your PathToAntBin directory. If it is not, then you should change it (Tools -> [Lamw] Android Module Wizard -> Paths Settings: Path to ant bin).

tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
Re: Error Building APK with LAMW/Windows
« Reply #7 on: April 24, 2016, 03:09:43 pm »
Many thanks, now it is working.

The problem was that I had several SDK installed and was not updating the one used by lamw.

There are several wrong things in the PDF tutorial, and some informations and explanations to add.
The Wiki page has some useful informations, but is missing details.
Don't you think it is better to maintain only the Wiki page, and delete the PDF to avoid confusion.

Best regards
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2330
Re: Error Building APK with LAMW/Windows
« Reply #8 on: April 24, 2016, 05:06:33 pm »

OK. Can you add some important and useful information to wiki?

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

tintinux

  • Sr. Member
  • ****
  • Posts: 376
    • Gestinux
Re: Error Building APK with LAMW/Windows
« Reply #9 on: April 25, 2016, 09:34:49 am »
Hi

I have created a new page for installation of LAMW to allow others to check and update it.
It is directly coming from the PDF by Dieselnutjob, with a few corrections and remarks from my recent experience.
I can't finish today, but will add images as soon as possible.
Everyone of course is welcome to check and improve it !

I suggest to remove the PDF from the distribution, or to change it to contain only a link to this new wiki page, since it will not be updated.

I didn't change the old page although it is today useless, and for now there is no link to the new page. After some validation of the new page, I think the old page could be an entry point to the new one and contain only general informations about Lazarus/Android or  links to other tools or pages related.

Regards,
Tintinux

« Last Edit: April 25, 2016, 09:36:52 am by tintinux »
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

 

TinyPortal © 2005-2018