0

I have problem with compile android application.

This is my error:

java.lang.OutOfMemoryError: Java heap space 

and

> com.android.tools.r8.CompilationFailedException: Compilation failed to complete

I set javaMaxHeapSize to maximum:

    dexOptions {
        javaMaxHeapSize "4g"
    }

Project is compiling but even then after one hour it goes with errors.

How could I solve this issue?

Takeshi567
  • 31
  • 5
  • 1
    increase your pc virtual memory – Rohit Kumar Jul 27 '21 at 16:18
  • 1
    I am not sure if the `dexOptions` are used at all in modern Andorid gradle plugin versions because `dex`is no longer used (r8 is now used). But increasing the gradle heap in general should work: https://stackoverflow.com/a/56420408/150978 – Robert Jul 27 '21 at 16:24

0 Answers0