failed to create JVM: error code -1,
JVM path: C:\Program Files\Java\jdk1.8.0_91\jre
If you already have a 64-bit JDK installed, define a JAVA_HOME variable in
Computer>System Properties>System Settings>Environment Variables.
Hi guys! if you have this issue with your Android Studio, you may be asked to fix JDK, jre or Environment Variables but don't stuck with the JDK or jre instead follow this solution:
1- Go to
C:\Program Files\Android\Android Studio\bin
2- Open
studio64.exe.vmoptions (for 64bit system)/
studio.exe.vmoptions (for 32bit system)
3- Replace this file with the following code
#
# *DO NOT* modify this file directly. If there is a value that you would like to override,
# please add it to your user specific configuration file.
#
# See http://tools.android.com/tech-docs/co...
#
-server
-Xms128m
-Xmx4096m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=200m
-XX:+UseCompressedOops
-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
4- Save the file and reopen your Android Studio
Note: in case if you can't edit the studio.exe.vmoptions file! showing "Access denied". copy the file to other location then edit and save. delete the file exist in C:\Program Files\Android\Android Studio\bin and copy edited file to the location.
-In addition if you're trying to fix AVD!
I am suggesting you not to do that instead install
bluestacks which runs faster than AVD.