Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic build android error (:transformClassesWithDexForDebug)

Everything was fine and working perfectly till i execute the command "ionic build android" and then this error occurs.

:transformClassesWithDexForDebugjava.lang.UnsupportedClassesVersionError: com.android.dx/command/Main : Unsupported Major.minor version 52.0

and so on......

enter image description here

like image 933
Najam Us Saqib Avatar asked Jul 04 '16 10:07

Najam Us Saqib


1 Answers

Looks like you have an old version of Java. Update your JDK to Version 8.

You can download it : here

Also don't forget to set your JAVA_HOME variable to new version (via Control Panel -> System -> Advanced -> Environment Variables) and then restart. Make sure that when you build your project, it will indicate that you're using JDK version 8.

You might have gradle problem. To fix it, do the following:

npm install -g gradle
ionic platform rm android
ionic platform add android
ionic build android
like image 197
Kirill Chatrov Avatar answered Nov 15 '22 05:11

Kirill Chatrov