Error:Execution failed for task ':app:transformClassesWithDexForDebug' in android studio

The Solution to Error:Execution failed for task ':app:transformClassesWithDexForDebug' in android studio is

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1

The upper error occure due to lot of reason. So I can put why this error occure and how to solve it.

REASON 1 : Duplicate of class file name


when your refactoring of some of your class files to a library project. and that time you write name of class file So, double check that you do not have any duplicate names

REASON 2 : When you have lot of cache Memory


Sometime if you have lot of cache memory then this error occure so solve it. go to File/Invalidate caches / Restart then select Invalidate and Restart it will clean your cache memory.

REASON 3 : When there is internal bug or used beta Version to Switch back to stable version.


Solution is just simple go to Build menu and click Clean Project and after cleaning click Rebuild Project.

REASON 4 : When you memory of the system Configuration is low.


open Task Manager and stop the other application which are not most used at that time so it will free the space and solve OutOfMemory.

REASON 5 : The problem is your method count has exceed from 65K.


open your Project build.gradle file add

defaultConfig {
        multiDexEnabled true

and in dependencies add below line.

       compile ''

~ Answered on 2016-05-28 12:23:26

Most Viewed Questions: