Hi Jakob,

Try this, It's work for me. Note that the "setlocal
EnableDelayedExpansion" is important

@echo off
setlocal EnableDelayedExpansion

set prog=%~f0
cd %~dp0

set jarfile=apkbuilder.jar
set frameworkdir=C:\android-sdk-windows-1.0_r1\tools\lib
set libdir=C:\android-sdk-windows-1.0_r1\tools\lib

set CP=
for %%f in (%libdir%\*.jar) do set CP=!CP!;%%f
set classpath=%classpath%;%CP%

call java  -Djava.ext.dirs=%frameworkdir%  -Djava.library.path=%libdir
% -jar %libdir%\%jarfile% %*

thankyou

On Sep 25, 10:52 pm, Jakob Sachse <[EMAIL PROTECTED]> wrote:
> meanwhile i did some try and error and got it running.
>
> setting frameworkdir and libdir to the lib folder works, manipulating
> the java.libraray.path property did't influence
> anything i could observe.
>
> so thats what the interesting part of my apkbuilder.bat looks like
> now:
>
> ===================
> set jarfile=apkbuilder.jar
> set frameworkdir=D:\My\Path\to\android-sdk-windows-1.0_r1\tools\lib\
> set libdir=D:\My\Path\to\android-sdk-windows-1.0_r1\tools\lib\
>
> if exist %frameworkdir%%jarfile% goto JarFileOk
>     set frameworkdir=lib\
>     set libdir=lib\
>
> if exist %frameworkdir%%jarfile% goto JarFileOk
>     set frameworkdir=..\framework\
>     set libdir=..\lib\
>
> :JarFileOk
>
> set jarpath=%frameworkdir%%jarfile%
>
> call java -Djava.ext.dirs=%frameworkdir% -Djava.library.path=%libdir% -
> jar %jarpath% %*
> ===================
>
> I think I could have well spared libpath, doen't change a thing here.
> But i left it pointing to the same directory as frameworkdir.
>
> Am i the only one getting in trouble with apkbuilder?
>
> On 25 Sep., 16:30, Jakob Sachse <[EMAIL PROTECTED]> wrote:
>
> > I wanted to pass dx some parameters when building a project using ADT
> > with Eclipse, I didn't find how, so I turned to ant.
>
> > I created a empty project with the activitycreator tool.
> > I put the generated build.xml into my actual project.
> > Then I modified the build.xml to match my project and i inserted the
> > dx parameter (which is --core-library)
>
> > Now I wanted to build the project.
> > It worked fine, all classes where compiled and put in the
> > classes.dex.
> > But when ant came to building the .apk it failed.
> > Giving me the error: " Unable to access jarfile ..\framework
> > \apkbuilder.jar "
>
> > I looked for the apkbuilder.bat and the didn't quite understand it.
> > There is a reference made to some framework directory that i don't
> > have.
> > The part that I don't understand is that one:
>
> > ====================
> > set jarfile=apkbuilder.jar
> > set frameworkdir=
> > set libdir=
>
> > if exist %frameworkdir%%jarfile% goto JarFileOk
> >     set frameworkdir=lib\
> >     set libdir=lib\
>
> > if exist %frameworkdir%%jarfile% goto JarFileOk
> >     set frameworkdir=..\framework\
> >     set libdir=..\lib\
>
> > :JarFileOk
>
> > set jarpath=%frameworkdir%%jarfile%
>
> > echo java -Djava.ext.dirs=%frameworkdir% -Djava.library.path=%libdir% -
> > jar %jarpath% %*
> > ====================
>
> > Obviously the script tries to determine the location of
> > apkbuilder.jar, but it fails due to the wrong directories.
>
> > I modified the script so that i had a correct path to apkbuilder.jar.
> > As result the java vm started but returned immidiatly saying:
>
> > Exception in thread "main" java.lang.NoClassDefFoundError: com/android/
> > prefs/And
> > roidLocation$AndroidLocationException
> > Caused by: java.lang.ClassNotFoundException:
> > com.android.prefs.AndroidLocation$A
> > ndroidLocationException
> >         at java.net.URLClassLoader$1.run(Unknown Source)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at java.net.URLClassLoader.findClass(Unknown Source)
>
> > Did I overlook something?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to