[Lazarus] Android build without ant

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Mon Mar 26 17:19:08 CEST 2012


Hello,

Ok, so far I have this script:

=================
cmd

SET PATH=C:\Programas\android-sdk\tools;C:\Programas\android-sdk\platform-tools\;C:\Progra~1\Java\jdk1.6.0_20\bin

mkdir bin
mkdir bin\classes

javac -classpath
C:\Programas\android-sdk\platforms\android-8\android.jar -d
bin\classes src\com\pascal\lcltest\LCLActivity.java

dx --dex --no-strict --output=bin\classes.dex
F:\Programas\lazarussvn\examples\androidlcl\android\bin\classes\com\pascal\lcltest\LCLActivity.class

apkbuilder bin\androidlcltest-unsigned.apk -u -z
bin\androidlcltest.ap_ -f bin\classes.dex

pause
====================

But when executing "dx -dex" I have a lot of errors.

If I don't put a full path, but just write
bin\classes\com\pascal\lcltest\LCLActivity.class it will say it can't
find the class file.

If I don't use --no-strict it will say that the paths don't match

And like I am using it now I get:

F:\Programas\lazarussvn\examples\androidlcl\android>dx --dex --no-strict --outpu
t=bin\classes.dex F:\Programas\lazarussvn\examples\androidlcl\android\bin\classe
s\com\pascal\lcltest\LCLActivity.class

UNEXPECTED TOP-LEVEL ERROR:
java.io.FileNotFoundException: bin\classes.dex (System nie mo┐e odnalečŠ okreťlo
nej ťcie┐ki)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at com.android.dx.command.dexer.Main.openOutput(Main.java:708)
        at com.android.dx.command.dexer.Main.run(Main.java:239)
        at com.android.dx.command.dexer.Main.main(Main.java:174)
        at com.android.dx.command.Main.main(Main.java:95)

Which is complete non-sense ... it should create this file =/

PS: Ok, now I found ... if I put the full path for the output file it
seams to work. So I will send this anyway in case someone in the
future has the same issue.

Going further it simply stops while running apkbuilder and says
nothing which makes me really lost =)

And it is really annoying that the entire script quits running if any
command fails, is there any way to make it more resistent? I would
like it to stop at the final pause so that I can more easily see the
output ... even if some commands fail I'd like it to keep running...

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list