Search code examples
debuggingemulationclassnotfoundexceptionandroid-studio

ClassNotFoundException Android Studio debugging


I installed Android Studio, imported a project and started debugging. All was ok until suddenly I started the debugger and got ClassNotFoundException for the launch of the main Activity. The strange thing is that if I run the project or I debug it with a virtual device all is fine. Only the device give this problem. Do you have any suggestion? Thanks


Solution

  • I ran into this. My app had been running fine and one day it just started running into these ClassNotFoundExceptions. My code hadn't changed at all.

    As far as I can tell, it ended up being a bug in the build of Android Studio. I had recently updated to the latest release on the canary channel.

    Switching back to an older release on the dev channel got things working again:

    1. Go into Settings / IDE Settings / Update
    2. Change to Dev Channel and Check Now.