b2amedina | 15 Jun 2010 21:25
Picon

Android Library Broken

Has anyone been able to get an APK that uses an android library to
compile using ant?

This works fine from eclipse but from the command line I always get a
null pointer exception:

Buildfile: build.xml
    [setup] Android SDK Tools Revision 6

BUILD FAILED
java.lang.NullPointerException
	at
com.android.ant.SetupTask.processReferencedLibraries(SetupTask.java:
473)
	at com.android.ant.SetupTask.execute(SetupTask.java:200)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
288)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
(Continue reading)

Xavier Ducrohet | 15 Jun 2010 21:35
Favicon

Re: Android Library Broken

make sure you have the "libs" project in your library project (even if
it's empty)

This is fixed for the next version.

On Tue, Jun 15, 2010 at 12:25 PM, b2amedina <b2amedina <at> gmail.com> wrote:
> Has anyone been able to get an APK that uses an android library to
> compile using ant?
>
> This works fine from eclipse but from the command line I always get a
> null pointer exception:
>
> Buildfile: build.xml
>    [setup] Android SDK Tools Revision 6
>
> BUILD FAILED
> java.lang.NullPointerException
>        at
> com.android.ant.SetupTask.processReferencedLibraries(SetupTask.java:
> 473)
>        at com.android.ant.SetupTask.execute(SetupTask.java:200)
>        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
> 288)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> 25)
(Continue reading)

Xavier Ducrohet | 15 Jun 2010 21:35
Favicon

Re: Android Library Broken

I meant libs _folder_ in your library project.

On Tue, Jun 15, 2010 at 12:35 PM, Xavier Ducrohet <xav <at> android.com> wrote:
> make sure you have the "libs" project in your library project (even if
> it's empty)
>
> This is fixed for the next version.
>
> On Tue, Jun 15, 2010 at 12:25 PM, b2amedina <b2amedina <at> gmail.com> wrote:
>> Has anyone been able to get an APK that uses an android library to
>> compile using ant?
>>
>> This works fine from eclipse but from the command line I always get a
>> null pointer exception:
>>
>> Buildfile: build.xml
>>    [setup] Android SDK Tools Revision 6
>>
>> BUILD FAILED
>> java.lang.NullPointerException
>>        at
>> com.android.ant.SetupTask.processReferencedLibraries(SetupTask.java:
>> 473)
>>        at com.android.ant.SetupTask.execute(SetupTask.java:200)
>>        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
>> 288)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>> 39)
(Continue reading)

b2amedina | 15 Jun 2010 22:49
Picon

Re: Android Library Broken

I already tried that.

I even went as far as making sure there were jar files in that
directory and I still get the same problem.

I also tried compiling the TicTacToe sample which shows how to use the
new android-library function and it also fails the same way.

I am running on Mac so I had a diff developer try it on his Windows
box and he also gets the same problem.

On Jun 15, 3:35 pm, Xavier Ducrohet <x... <at> android.com> wrote:
> I meant libs _folder_ in your library project.
>
>
>
>
>
> On Tue, Jun 15, 2010 at 12:35 PM, Xavier Ducrohet <x... <at> android.com> wrote:
> > make sure you have the "libs" project in your library project (even if
> > it's empty)
>
> > This is fixed for the next version.
>
> > On Tue, Jun 15, 2010 at 12:25 PM, b2amedina <b2amed... <at> gmail.com> wrote:
> >> Has anyone been able to get an APK that uses an android library to
> >> compile using ant?
>
> >> This works fine from eclipse but from the command line I always get a
> >> null pointer exception:
(Continue reading)

b2amedina | 15 Jun 2010 23:19
Picon

Re: Android Library Broken

I just re-read your post.

I was creating a libs folder in my application project not my library
project.

As soon as I created a libs fodler in the library project it worked.

Thanks,

On Jun 15, 3:35 pm, Xavier Ducrohet <x... <at> android.com> wrote:
> I meant libs _folder_ in your library project.
>
>
>
>
>
> On Tue, Jun 15, 2010 at 12:35 PM, Xavier Ducrohet <x... <at> android.com> wrote:
> > make sure you have the "libs" project in your library project (even if
> > it's empty)
>
> > This is fixed for the next version.
>
> > On Tue, Jun 15, 2010 at 12:25 PM, b2amedina <b2amed... <at> gmail.com> wrote:
> >> Has anyone been able to get an APK that uses an android library to
> >> compile using ant?
>
> >> This works fine from eclipse but from the command line I always get a
> >> null pointer exception:
>
> >> Buildfile: build.xml
(Continue reading)

ydario | 14 Jul 2010 17:12
Picon
Favicon

Re: Android Library Broken

Hello Xavier,

> make sure you have the "libs" project in your library project (even if
> it's empty)

this fixed my ant builds from terminal, but not from Eclipse.
I have added my buildfiles to Ant eclipse page, but now clicking the
run button gives the same NullPointer problem.

Is there a way to fix this also for Eclipse?

thanks,

Yuri

--

-- 
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Robert D. | 13 Jan 2012 06:01
Picon

Re: Android Library Broken


look here http://www.enterra-inc.com/techzone/
using_ant_android_applications_building/ hope it could be useful

--

-- 
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 <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Gmane