This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/3.3/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap
http://www.th7.cn/Program/Android/201702/1119428.shtml
Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap
This means that the JVM does not have enough memory space. gradle add the following properties. Properties file will solve your problem!
solution:
1: Create a gradle.properties file in your personal folder ( (C:/Users/username/.gradle or ~/.gradle)), add
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
2: Or add the following line directly to the gradle.properties file in Android Studio, and modify it if it exists
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m