This is the first time I’ve used a 3rd party jar, but it seems like I’m doing everything right. I’m using Jsoup to parse HTML.
In my project, under Properties->Java Build Path I have added the external jsoup jar. Under Order and Export I have tried jsoup both checked and unchecked. Seems to have made no difference. When writing my app, eclipse was able to find the right imports, autocomplete methods/constructors. Eclipse seems to see Jsoup fine.
However, when I run my app, one of my activities calls methods from Jsoup. Whenever I launch that activity, I get the following error.
Could not find method org.jsoup.parse, referenced from method...
VFY: unable to resolve state method 348: Lorg/jsoup/Jsoup; parse...
Am I not importing it properly? Why can it not find jsoup? The above steps seem to be the answer to all the questions on importing a 3rd party jar to Android in eclipse.
My best guess is that eclipse can see the jsoup.jar, but it does not package up the parts I need with the app, so the app is unable to use them. Not sure if that’s it, but if it is, how would I force eclipse to package it so the app can use it from anywhere?
Invoke the Eclipse function
Organize Importsby pressing Shift+Alt+O and that should take care of everything.