Monday, August 25, 2014

Custom android.app.Application and ClassNotFoundException

I've encountered this error so many times... and every single time it was something so stupid I had to waste (in total I would estimate) hours to solve, and sometimes stupidity repeats itself.

So I'll name here a few cases I remember:
  • When you encounter this in your published application, if you haven't done something extremely stupid, like not exporting the application class, then this is mostly an OS update thing... that it tries to launch the application between the removal of the older version and the installation of the newer one.
  • While you see this in your logcat when launching the application from your IDE, it can be one of the following:
    • You do not export the workspace dependencies of your Android application.
    • One or more of your Android libraries paths are incorrect.

Also sometimes you might have an error on your project node in the "package explorer", but all the content of the project seems fine, well this is because one of your Android libraries has one of the above dependency issue.

Hope I saved you a minute... :)

+1 if this helped you!