How to Fix Java.lang.OutOfMemoryError: Java heap space Android Studio

0
213
Java.lang.OutOfMemoryError: Java heap space Android Studio

Java.lang.OutOfMemoryError: Java heap space Android Studio .

How to Fix Java.lang.OutOfMemoryError: Java heap space Android Studio

  1. in gradle.properties file add this code
    org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
    org.gradle.daemon=true
    org.gradle.parallel=true
    ogr.gradle.configureondemand=true
  2. then build project .