android工作室应用程序不能运行在windows7机器

android studio application cannot be run in windows 7 machine

在我的 Android 工作室中 运行 应用程序出现以下错误。

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

我有 32 位 windows 7 台机器,无法 运行。 请告诉我如何清除错误。

好的,首先您必须将 AVD(Android 虚拟设备)重新配置为更小的堆大小,这可以通过工具>Android>AVD 打开 AVD 管理器来完成马槽

您应该会在打开的 window 中看到您的虚拟设备。选择 window 右侧的绿色铅笔图标以编辑设备配置。

设备的堆、存储和 RAM 设置可在高级设置选项下找到。您可以修改它们以适合您的计算机。

请注意,您的 ADV 性能取决于您使用的计算机的硬件(这意味着当您的计算机内存不超过 4 Gb 时,您无法 运行 在 4Gb RAM 上进行 AVD)

我已经安装了 Windows 7 32 位并使用了 8 Ram,所以系统只使用了 4GB 我已经安装了 64 位 OS。现在可以使用了。