Bhavita Lalwani
Bhavita Lalwani

Reputation: 903

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

Upvotes: 5

Views: 7423

Answers (6)

Anita
Anita

Reputation: 35

For those that are using the Android studio version 4, can find the studio64.exe.vmoptions in the following path: C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudio4.1

as mentioned here in the official documentation of Android: https://developer.android.com/studio/intro/studio-config

Upvotes: 0

Louis Tsai
Louis Tsai

Reputation: 1667

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

Upvotes: 0

Kumar Utsav
Kumar Utsav

Reputation: 1

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.

Upvotes: 0

user339884
user339884

Reputation: 31

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.

Upvotes: 0

Ary
Ary

Reputation: 351

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).

Upvotes: 3

Aryeh
Aryeh

Reputation: 336

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.

Upvotes: 30

Related Questions