0

Using Android Studio 3.0 Beta 6. This error is happening more and more, when I try build my project:

Error:Execution failed for task ':app:compileDebugJavaWithJavac'. java.lang.OutOfMemoryError: GC overhead limit exceeded

I have tried to fix it using this SO answer: Android Studio: GC overhead limit exceeded

However it has made no difference. The only way to fix it, is a reboot of my MBP and then all is fine for the next few builds, until it resurfaces again.

Any ideas how to fix this?

Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99

1 Answers1

1

I was facing the same issue and it is resolved by adding following codes, Add this to your build.gradle file:

dexOptions { 
          incremental true 
          javaMaxHeapSize "4g" 
} 
Kuls
  • 2,047
  • 21
  • 39