Joe
Joe

Reputation: 301

java.lang.ClassNotFoundException DexPathList . Causes?

Can anyone explain to me the cause of this error? I know what is dexpath and dex class in android and how to fix this error. but don't know what is the cause of this error popping up every now and then.

This error occurs when

  1. I transfer my project from one pc/laptop to another pc/laptop.
  2. Whenever I've updated my android Studio lets say from AS 2 to AS 3 canary or stable release.
  3. Uninstall and reinstall the Android studio and try opeining the Project again.

How I'm Fixing it: Just remove all the dependencies and everything related to DEX Class file from gradle and sync it and then revert back to gradle settings with all the DEX file and dependencies added and Sync again. VOILAAA ..

And this is really annoying. How I can avoid this issue for my other projects without going through all this gradle sync tweak.

Upvotes: 0

Views: 423

Answers (1)

deejay
deejay

Reputation: 572

I had the same issue with moving projects to different system. when you move your project folder just leave out the build folder and you'll not see the error next time.

The error says a lot more then just class not found exception in the log. The path of the files/ app-parts.apk gets invalid when you move your project to a different system.

Just don't copy or just rename the old build folder to something else and open your project in AS. Build->CLEAN , BUILD->REBUILD and everything will work.

Happy Coding..

Upvotes: 1

Related Questions