此问题在此处已有答案:
Unrecognized VM option 'MaxPermSize=512m' and Could not create the Java Virtual Machine when running React Native Apps (closed)(2个答案)
上个月关门了。
我刚把我的Android Studio 升级到
Android Studio Flamingo | 2022.2.1 Patch 2
Build #AI-222.4459.24.2221.10121639, built on May 12, 2023
Runtime version: 17.0.6+0-17.0.6b802.4-9586694 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.5.1
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 8
Metal Rendering is ON
Registry:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
gradle.version.catalogs.dynamic.support=true
字符串
但突然我的react native项目无法在android studio中启动
我得到的错误时,它的同步到我的项目在这里是它看起来像
的数据
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.2.1/userguide/gradle_daemon.html
Process command line: /Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home/bin/java -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=ID -Duser.language=en -Duser.variant -cp /Users/mochammadhendy_l/.gradle/wrapper/dists/gradle-6.2.1-bin/5m14x4d33sfxbtkeo25s43l8q/gradle-6.2.1/lib/gradle-launcher-6.2.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.2.1
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.
-----------------------
Check the JVM arguments defined for the gradle process in:
- gradle.properties in project root directory
型
gradle.properties
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true
型
有没有什么方法可以在不降级情况下修复
1条答案
按热度按时间7ajki6be1#
您的设置中存在两个主要问题。
1.您正在使用Java版本运行与您的Gradle版本不兼容的Gradle。有关详细信息,请参见https://docs.gradle.org/current/userguide/compatibility.html。
1.如错误所示,您正在
org.gradle.jvmargs
中使用-XX:MaxPermSize
。由于Java 8也是运行Gradle的最低支持版本,因此该选项不再使用,因此该选项完全无用。此外,在此期间,该选项已被删除,因此您尝试使用该选项启动时会出现硬错误。删除该选项后,此部分的所有内容都应该正常,但第1点仍然有效。