Reputation: 1907
My Android project references external classfiles that are not included in the in the Android SDK. I added those classes as an external library properly in eclipse. The code compiles with no problem. But as I try to run the application I get an ClassNotFoundException by the DalvikVM, although all the neccessary classes have been ported.
Am I missing something?
The steps I did.
EDIT:
I tried to add the external jar now. I get the following errors when eclipse is rebuilding the build path:
"warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)"
That comes for every class file in the jar apparently.
and: "Dex Loader]Unable to execute dex: null" and: "Conversion to Dalvik format failed: Unable to execute dex: null"
Upvotes: 1
Views: 4014
Reputation: 3785
The Android Development Tools (ADT) - I assume you're using this to build your project - will only pick-up external jars that are located in the "libs" folder of your Android project. Otherwise, they won't get picked up and converted to Dalvik bytecode and added to your classes.dex file:
http://mylifewithandroid.blogspot.com/2010/01/jars-on-classpath.html
Unfortunately, it won't add classes that you just add to your Java project build path.
Upvotes: 1
Reputation: 91175
right click and go to Properties of your project.
select Java Build Path-->libraries-->add external class folder(which contains your class files.)--> Ok. that it. hope it helps.
Upvotes: 1