After upgrade of Android Studio 3.4 getting below error.
Gradel plugin version is: 3.4.0
Out of memory: Java heap space. Please assign more memory to Gradle in the project's gradle.properties file. For example, the following line, in the gradle.properties file sets the maximum Java heap size to
1,024 MB: org.gradle.jvmargs=-Xmx1024m Read Gradle's
configuration guide Read about Java's heap size
OR
GC overhead limit exceeded
I have applied below solution but it doesn't work.
Option: 1
dexOptions {
javaMaxHeapSize "4g"
}
Option: 2
org.gradle.configureondemand=false
Option: 3
Open gradle.properties file from your project tree add this line at the memory allocation line
org.gradle.jvmargs=-XX\:MaxHeapSize\=256m -Xmx256m
or
org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m
or
org.gradle.jvmargs=-XX\:MaxHeapSize\=1024m -Xmx1024m
Please help me to solve this issue. Thanks in Advance!
1024M is not much for Gradle, for example:
# @see https://docs.gradle.org/current/userguide/build_environment.html
org.gradle.jvmargs=-Xmx5084M -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.configureondemand=true
org.gradle.parallel=true
try values alike -Xmx2048M
or -Xmx4096M
...
I don't know it is a valid answer or not.
I have downgraded my gradle plugin version 3.4.0
to 3.3.2
It's work perfectly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With