I have just installed Android – studio today. First I have to install jdk7 for this IDE.
After that only I was able to launch IDE.
Now When I am trying to create new project, just getting error as shown in below image.
Can anybody please help me.
What is missing from my side?
In my case, I changed below file to modify vm heap option.
I increased -Xms128m to -Xms512m and restarted Android Studio.
After that, I could go to next step.
I found a solution to this problem on an old vs-android issue.
You should create a new environment variable named
_JAVA_OPTIONS, set it to
-Xms256m -Xmx1024m and it should work.
I guess you have the same problem as me. I use Windows 7 32bit and therefore my Java SDK and runtime are also 32 bit.
Gradle runs in its own Java VM and Android Studio starts this VM with a heap size parameter (-Xmx1024m) of 1 GB. This is too much for my 32-bit environment and creating the JVM fails.
If I manually start Gradle with -Xmx512m as JVM option Gradle starts without problems, but so far I have not found out how to tell Android Studio to start the JVM differently while it creates a new Android project.
So currently I’m also still stuck.
1.In the Studio, navigate to
In the VM Options text box, paste this line -Xmx512m -XX:MaxPermSize=512m
Delete the existing AVD.
Then File->Invalidate Caches/Restart .
After restarting the studio, create a new AVD.
Should work fine !
I found the solution in vs-android Issue 15: -dex: could not create the Java virtual machine
Follow this steps:
- Run regedit
- Go to
- Select Environment
- Add a new String Value and enter
_JAVA_OPTIONSfor Value name
-Xms256m -Xmx512mfor Value data
- Reboot computer
In my case, I also change below file.
but I decreased -XX:MaxPermSize=350m to -XX:MaxPermSize=300m and restarted Android Studio.
I was having the same problem. I downloaded and installed JDK 6u43 and set my JAVA_HOME and JDK_HOME environment variables to C:\Program Files (x86)\Java\jdk1.6.0_43. This let me create a project.
Doesn’t help if you want to use jdk7, though.
I was facing this same issue, and I solved it by the following steps:-
- Close android studio.
- Go to your project folder.
- Now start android studio project and wait while gradle build.
It will not show the error.