“Android java.lang.NoClassDefFoundError: org.jsoup.Jsoup” adding jar to /libs doesn't work?

a 夏天 提交于 2019-12-10 22:18:42

问题


I'm having the exact problem as described here. I followed the solutions here. I have added the jsoup jar to the \libs folder but it just still won't work. Tried loads of different stuff like deleting the jar and re-downloading but nothing has worked? At a loss at what else I can do?


回答1:


Found the answer here Basically just needed to tick the got to the 'Order and Export' tab and check 'Android Private Libraries'




回答2:


You are doing it wrong. You cant use Jsoup functions in the on-create of Activity. You need to make either Async Task or thread.

This is to prevent doing blocking tasks in you activity.

Here is a nice blog that explain how to do it and provide sample code as well.

Sample Code Click here




回答3:


Put Jsoup.jar both in the AP and ACP. In both projects it should reside in libs, imported as jar by eclipse. Clean the project and it will work.

I had a similar problem, with this context:

  • Android Project (doesn't need itself jsoup)
  • Android Class Project (needing jsoup)
  • Jsoup.jar

I've imported the ACP in AP, with all classes, but it seems to won't recognize jsoup, that was needed to prevent errors during compilation.



来源:https://stackoverflow.com/questions/16679911/android-java-lang-noclassdeffounderror-org-jsoup-jsoup-adding-jar-to-libs-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!