I've freshly installed Mac Monterey OS
with latest version of Java JDK 17
& XCode 13.1
When I run npm run android
to build my project I get below error.
unrecognized VM option 'MaxPermSize=4096m'
Error: Could not create the Java Virtual Machine
CodePudding user response:
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.
CodePudding user response:
I got the same issue. The fix in my case was to refer to a correct version of 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. To check it go to File > Other Settings > Default Project Structure > JDK location
and check the path. Select the correct version of JDK. If you don't have a 64-bit JDK then download and install it.