[英][react-native][Xcode 13.1] unrecognized VM option 'MaxPermSize=4096m' Mac M1 (Monterey)
I've freshly installed Mac Monterey OS
with latest version of Java JDK 17
& XCode 13.1
我刚刚安装了最新版本的
Mac Monterey OS
和 Java JDK 17
& XCode 13.1
When I run npm run android
to build my project I get below error.当我运行
npm run android
来构建我的项目时,出现以下错误。
unrecognized VM option 'MaxPermSize=4096m'
Error: Could not create the Java Virtual Machine
After spending 2hrs on this issue I removed the Java JDK 17
and installed jdk-15.0.2
because in Big Sur
i was using this version itself & this fixed the problem and the project build was successful.在这个问题上花了 2 小时后,我删除了 Java
JDK 17
并安装了jdk-15.0.2
,因为在Big Sur
我自己使用的是这个版本,这解决了问题并且项目构建成功。
I got the same issue.我遇到了同样的问题。 The fix in my case was to refer to a correct version of JDK .
在我的情况下,解决方法是引用正确版本的 JDK 。 My Android Studio is 64-bit (on Windows you can see it in task manager as studio64.exe) while it was referring to 32-bit JDK.
我的 Android Studio 是 64 位的(在 Windows 上,您可以在任务管理器中看到它为 studio64.exe),而它指的是 32 位 JDK。 To check it go to
File > Other Settings > Default Project Structure > JDK location
and check the path.要检查它 go 到
File > Other Settings > Default Project Structure > JDK location
并检查路径。 Select the correct version of JDK. Select JDK 的正确版本。 If you don't have a 64-bit JDK then download and install it.
如果您没有 64 位 JDK,请下载并安装它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.