Solution: Increase JVM Metaspace Allocation
Modify gradle.properties: In your Flutter project directory, navigate to the android folder and locate the gradle.properties file. Add or update the following line to increase the maximum metaspace size:
.gradle.jvmargs=-XX:MaxMetaspaceSize=512m
Solution: Increase JVM Metaspace Allocation
Modify gradle.properties: In your Flutter project directory, navigate to the android folder and locate the gradle.properties file. Add or update the following line to increase the maximum metaspace size:
.gradle.jvmargs=-XX:MaxMetaspaceSize=512m
Share
Improve this question
asked Mar 27 at 8:59
Hammad KhanHammad Khan
816 bronze badges
1
- I updated my answer; you may check it out now. – DevQt Commented Mar 28 at 4:30
1 Answer
Reset to default 1Use this configuration in your gradle.properties
file:
.gradle.jvmargs=-Xmx4608m -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
EDIT: Perform Cache Clearing If Necessary
After configuring your gradle.properties
file, if necessary, clear the caches.
You may follow this relevant answer thread
or...
If you're using Android Studio, perform File > Invalidate Caches...
I hope this helps!