Java libraries, stub files and binding.

59 views
Skip to first unread message

F H

unread,
Mar 4, 2010, 10:00:16 AM3/4/10
to android-platform
Hi all,

I am trying to:

Create a Java library that is a part of the platform.
Create a Jar file that contains just stubs for the library for developers to use.
Create an application that uses the <uses-library> clause and the stub jar file to bind to the library from an Eclipse environment.

It almost works, if I omit the uses-library clause from the application, I get an
exception thrown (gets generated by the stub library I use for building). If I add
the clause back in, then I get a run-time error "Class resolved by unexpected DEX:"
reported by vm/oo/Resolve.c - about line 143.

The error implies that the class in the library I'm trying to use is not derived from
the same place as the one I'm building with. This is true - as I'm using a stub library
for building in Eclipse (as an external JAR), which is different from the non-stubbed
version on the platform.

I create the stub library with the mkstub tool, using the classes.jar file associated
with the library that gets built when android is built.

My questions are:

Is the 'android.jar' file that ships with the SDK comprised of stubbed classes?
If so how does the android.jar get created?
Do I need to process my stub jar file in some other way to avoid Dalvik throwing this error?

Thanks for any help




Reply all
Reply to author
Forward
0 new messages