Cocos creator Compilation failed

Building mode: release
Using Android Studio project : C:\Users\wj\Documents\NewProject_3\build\jsb-link\frameworks\runtime-src\proj.android-studio
Building apk…
running: ‘“C:\Users\wj\Documents\NewProject_3\build\jsb-link\frameworks\runtime-src\proj.android-studio\gradlew.bat” --parallel --info assembleRelease’

Initialized native services in: C:\Users\wj.gradle\native
Removing daemon from the registry due to communication failure. Daemon information: DaemonInfo{pid=8048, address=[24fe41fc-faa9-4f98-8953-d1161dc24915 port:50165, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Idle, lastBusy=1647066454556, context=DefaultDaemonContext[uid=445518e2-09db-4d51-9bac-1697364fa583,javaHome=C:\Program Files\Java\jdk-17.0.2,daemonRegistryDir=C:\Users\wj.gradle\daemon,pid=8048,idleTimeout=10800000,daemonOpts=–add-opens,java.base/java.util=ALL-UNNAMED,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]}
Removing 2 daemon stop events from registry
Previous Daemon (8048) stopped at Sat Mar 12 17:36:43 CST 2022 by user or operating system
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Starting process ‘Gradle build daemon’. Working directory: C:\Users\wj.gradle\daemon\4.10.3 Command: C:\Program Files\Java\jdk-17.0.2\bin\java.exe --add-opens java.base/java.util=ALL-UNNAMED -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=GBK -Duser.country=CN -Duser.language=zh -Duser.variant -cp C:\Users\wj.gradle\wrapper\dists\gradle-4.10.3-all\47sla2vl0tc5qooe1dsb59pe1r\gradle-4.10.3\lib\gradle-launcher-4.10.3.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.10.3
Successfully started process ‘Gradle build daemon’
An attempt to start the daemon took 1.942 secs.

FAILURE: Build failed with an exception.

  • What went wrong:
    Unable to get mutable Windows environment variable map

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org
    Error running command, return code: 1.