Error on compilation


Android studio 1.5.1
Plugin 1.0
On compilation I have got this error time to time.
Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’. org.gradle.process.internal.ExecException: Process ‘command ‘/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java’’ finished with non-zero exit value 1

For solve this problem I should clean project and restart IDE.


I solve this problem by adding
dexOptions {
javaMaxHeapSize “2g”
to gradle
android {}