Search code examples
androidandroid-studioandroid-gradle-pluginandroid-studio-2.1

android studio application cannot be run in windows 7 machine


In my Android studio I got following error when run the application.

Error:Error: Could not create the Java Virtual Machine.
Error:Error: A fatal exception has occurred. Program will exit.
Error:Error: Could not create the Java Virtual Machine.
Error:Error: A fatal exception has occurred. Program will exit.
Error:Invalid maximum heap size: -Xmx4g
Error:The specified size exceeds the maximum representable size.
Error:Invalid maximum heap size: -Xmx4g
Error:The specified size exceeds the maximum representable size.
:dmart-android:transformClassesWithDexForDev FAILED
Error:Execution failed for task ':dmart-android:transformClassesWithDexForDev'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_101\bin\java.exe'' finished with non-zero exit value 1

I have 32 bit windows 7 machine and could not able to run. Please let me know how to clear the errors.


Solution

  • I have installed Windows 7 with 32 bit and used 8 Ram so the system only used 4GB only I have installed 64 bit OS. Now its working.