Search code examples
cordovagradlecmdenvironment-variables

Cordova error could not reserve enough space for 2097152KB object heap


I know this error is already everywhere on the internet, but all the fixes I tried didn't work. I tried to change the value in gradle.properties from -Xmx2048m to -Xmx512m, -Xmx1024m but they both didn't work. When i enter "cordova run android" it just changes back to -Xmx2048m. Here is the error message I'm getting: enter image description here The java version I am running: "1.8.0_291" Gradle version: "7.1.1"

Can someone please help me fix this, because I'm really lost.


Solution

  • I finally fixed it. I was changing the RAM values in gradles.properties, but when I changed it from -Xmx2048m to -Xmx1024m in C:\Users\mauro\Projects\App\platforms\android\cordova\lib\config\GradlePropertiesParser, it worked!