So I have a problem with memory allocation. Sometimes it works, and sometimes it doesn\'t. I\'ve read this thread and tried the advice there multiple times. Sometimes
In your android folder there is a gradel.properties file and add the following lines:
org.gradle.jvmargs=-XX\:MaxHeapSize\=256m -Xmx256m
I ran into this while using Intellij and Flutter. Also another property you may find useful to add is declaring where the JDK is.
org.gradle.java.home=C:\\Your\\JDK\\path