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.ScraperC开发者_开发知识库onfiguration', referenced from method html.parser.MainActivity.onCreate
any ideas?
I had a problem where a jar was not exported to the apk. I manually edited .classpath and added exported="true" to the classpathentry; seems to have fixed my similar problem.
<classpathentry kind="lib" exported="true" path="lib/gson-1.7.1.jar"/>
Take a look here http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary are you placing the jar in subfolder of your project ?
Well, first thing is to check that the library has the right java version. android only support 1.6 and not 1.7 (SDK dependent, but if you want it to work under 2.33, use 1.6) . after that, just drag the file to the libs folder, and select copy. Then, click project properties (right click on the project->properties)-> java build path->libraries tab. in this tab click add JARs and not add external JARs. Select the jar file from your project under the libs folder. If you are still getting the error, make sure your jar file java version is 1.6.
精彩评论