views:

49

answers:

1

Hi,

I created a new library and added the jars from web harvester to do a bit of web scraping in my android project. in my main activity I import classes that I need. but starting the project on my phone I get a

08-23 08:28:09.763: ERROR/dalvikvm(2123): Could not find class 'org.webharvest.definition.ScraperConfiguration', referenced from method html.parser.MainActivity.onCreate

any ideas?

A: 

Take a look here http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary are you placing the jar in subfolder of your project ?

Mojo Risin
well I created a user lib just as described in you link, I can access the classes in the lib and use them in my code. but when I run the project I get the error. so it seems that the classes are missing in the runtime
ArtWorkAD
You can use the classes because you included the jar in eclipse build path and you got the error because the jar is not exported in your .apk file. Create libs folder from the root of your project and place the jar there the eclipse plugin should export it automatically in the .apk file.
Mojo Risin
how do I exactly do this?
ArtWorkAD
right click on project -> create folder libs -> place you jar here -> edit your build path to use this location -> right click export to android project or something like this :)
Mojo Risin
ok, but there is another problem when I do this. eclipse is building workspace, and stucks at 22% it takes about 5 minutes and I get an error "Converting to dalvik format failed"
ArtWorkAD
Android is not using dalvik virtual machine so only jars that are build for dalvik can be used. Build your jar using eclipse from source .
Mojo Risin