Friday, 19 June 2015

Error Solving time - Android Studio - bad class file magic (cafebabe) or version (0034.0000) android studio

My friend got this error when he tried to import a project from Github, he asked me to try and see and I got the same issue as well. Finally we found that the issue was caused by the java compiler version.
Android supports 1.7 jdk version and if you are using a 1.8 version you might face this error.

This error came into picture when we tried to run the application, the normal gradle build was clean. On running the app gradle popped up with,
Local path doesn't exist 
and the cause was shown as
bad class file magic (cafebabe) or version (0034.0000) android studio

The fix:
1) Go to File > Other Settings > Default Settings > Build, Execution, Deployment > Compiler > Java Compiler, and change the Project bytecode version to 1.7

2)Go to File > Project Structure > SDK Location, here change the JDK locations path to that of a 1.7 version as below, for mac users give the jdk path till the Home folder.

Now try to build and run the project, it will be successfull. Thanks


No comments:

Post a Comment