This issue is just as problematic as it is common, with most Java programmers wanting to fix the issue as soon as it arises. Well, the following are two fixes that have worked for Android Development Tools users who have suffered from the issue in the past:
METHOD 1: Clean the project
Backup the project which needs to be cleaned. While cleaning is generally pretty safe, prevention is always better than medication.
- Navigate to the “Project” section in the toolbar.
- Select “Clean” from the drop down menu.
- In the window that opens subsequently, check “Clean projects selected below”.
- Select the projects that need to be cleaned.
- Click on “OK”.
METHOD 2: Check any unchecked libraries from the Build Path
Find the folder where the .jar libraries are located. This folder should be named “libs”. If the folder is named “lib” instead, right click on the folder, click on “Refactor” and then choose “Rename”. Rename the folder to “libs”. Right click on the project that is displaying the “java.lang.NoClassDefFoundError no apparent reason” error, choose “Build Path” and then select “Configure Build Path”. Navigate to the “Order and Export” tab. Check the boxes beside any .jar libraries (such as “gcm.jar” and “libGoogleAnalyticsV2.jar”) that are not already checked. Clean the project again.
How to Fix “Error 500: Java.Lang.NullPointerException"Fix Error Could not find Java SE Runtime EnvironmentHow to Fix Java Error Code 1603Fix: Windows Error 2 Occurred While Loading the Java VM