简体   繁体   中英

Android Studio : Failed to create JVM error code : -1

Please dont mark it as duplicate.

I did make changes as per other answers available when error code was -4. Now it is showing error code : -1.

Kindly give me some direction.

here is my studio.exe.vmoptions file

 server
-Xms256m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da
-Djna.nosys=true
-Djna.boot.library.path=

-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-Didea.paths.selector=AndroidStudio2.1
-Didea.platform.prefix=AndroidStudio

Had the same problem, this was my solution:

  1. go to C:\\Users\\ *username* \\\\.androidStudio\\ (your path might be a bit different, but make sure to go the local version of Android Studio, not the general version (that lives in the Program Files directory)),
  2. find the studio.exe.vmoptions (or studio64.exe.vmoptions ) file and delete it.
  3. try to open Android Studio again.

It worked for me, like said Aryeh in above answer.

  1. I opened the directory C:\\Users\\(myself)\\.AndroidStudio2.2 and deleted the file studio64.exe.vmoptions ( I did a copy before, with prefix OLD_, using a text editor ),
  2. Then launch Android Studio,
  3. Go to AS menu "Help > Edit Custom VM Options ..." (this makes a new file "studio64.exe.vmoptions" that you can edit).

Go in C drive and go to user ex: "C:\\Users\\vijay" and shift + delete all android and android studio folders. Then click and open Android studio. that's it.

Worked for me. If you have done some changes in the local files namely studio.exe.vmoptions or studio64.exe.vmoptions using wordpad (which i had done after reading some other solutions on google but they didn't worked for me ), then first undo those changes.

And for those who just edited their .vmoptions and messed it up, this is where that file is (according to this documentation ):

Both configuration files are stored in the configuration folder for Android Studio. The name of the folder depends on your Studio version. For example, Android Studio 3.3 has the folder name AndroidStudio3.3. The location of this folder depends on your operating system:

 Windows: %USERPROFILE%\\.CONFIGURATION_FOLDER macOS: ~/Library/Preferences/CONFIGURATION_FOLDER Linux: ~/.CONFIGURATION_FOLDER 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM