I am new to React Native and I recently build a simple application and I want to release it but I get the following error (I had followed every step mentioned in the blog by react native)
The Problem I encountered while running gradlew assembleRelease is FAILURE: Build failed with an exception
Output
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.9/userguide/gradle_daemon.html
Process command line: C:\Program Files\Java\jdk-18\bin\java.exe -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\Lucifer\.gradle\wrapper\dists\gradle-6.9-all\dooywd8nv05k16orzxge2b1bs\gradle-6.9\lib\gradle-launcher-6.9.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.9
Please read the following process output to find out more:
-----------------------
Unrecognized VM option 'MaxPermSize=512m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
I don't know if it is the problem with JDK
I have properly installed JDK (Version 18) and added the path to SDK in the environment variable
ANDROID_HOME = C:\Users\Username\AppData\Local\Android\Sdk
and I also have added the path to java/jdk-18/bin folder and platform-tools in environment paths variable
I tried some of the solutions from previous issues regarding this problem like this one but none of them worked. I tried reading documentation and GitHub issues but couldn't find relevant solution
so