1

I created a new module for my project for adding some extra features. In that module, I added Jsoup dependencies in module's Gradle file implementation 'org.jsoup:jsoup:1.10.2' and implement this code to parse a simple HTML code.

Document document =  Jsoup.parse(content);
Element element = document.body();
setElement(element);
Utils.appendView(this,getElement().children());
invalidate();

On running application, I'm getting this error trace with app crash.

E/UncaughtException: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jsoup/Jsoup;
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jsoup.Jsoup" on path: DexPathList[[zip
baldraider
  • 1,049
  • 2
  • 18
  • 48

1 Answers1

1

First, make sure that you added it to your manifest, then clean your project.

If you are using Eclipse, and the problem persists, follow the answer here: https://stackoverflow.com/a/22959847/8065149

If you are using Android Studio, try disabling instant run: Go to File -> Settings -> Build,Execution, Deployment -> Instant Run -> Uncheck the checkbox for instant run. Run your app once and this apk file shoudld work properly.

And if that small change didn't work, then try something might have went wrong in the incremental build system. One of this should help:

  1. Menu Build -> Rebuild project
  2. Delete folder /build
  3. Close Android Studio, delete /build folder
  4. Right click on your project -> "Open module settings" -> Dependencies tab -> check if Export is checked for your library
cjnash
  • 1,228
  • 3
  • 19
  • 37