无法 运行 Android 模拟器

Not able to run the Android Emulator

构建成功,但是当我尝试使用 AVD 运行 项目时,它显示以下消息。我不确定哪里出了问题。

Warning: No DNS servers found

emulator: device fd:608

HAXM is not working and emulator runs in emulation mode

emulator: The memory needed by this AVD exceeds the max specified in your HAXM configuration.

emulator: AVD RAM size = 1536 MB

emulator: HAXM max RAM size = 512 MB

emulator: You might want to adjust your AVD RAM size and/or HAXM configuration to run in fast virt mode.

creating window 43 59 329 583 emulator: UpdateChecker: skipped version check

HAXM RAM 大小应大于 AVD。 最好通过编辑模拟设备或以其他方式增加 HAXM RAM 大小来减少 AVD 的 RAM 大小。

HAXM RAM 大小应大于 AVD。减少 AVD 的 RAM 大小或增加 HAXM RAM 大小。

减少 avd 的 ram(我推荐)

去找你的avd经理。删除模拟器并创建一个新的。但是对于新的,请确保它的 ram 小于 512 mb。

您需要调整您的 adb ram 大小。

首先打开 android studio.Then 在顶部图标栏你可以找到这个 icon.Click it.This will open all available virtual device you have.Select your virtual device and at the right you can find this icon .Click it.This will open a new window.At the bottom of this window you can find this .Click it.Then there will be a section like this .Then change RAM size 1536 to 512.Like this 。现在点击完成并 运行 你的应用程序。

编辑:

如果您的目标 api 高于 19,那么您需要调整您的 haxm 安装程序内存大小,因为当您 运行 您的应用程序时,avd 内存大小将增加到 1 GB。 那么如何调整你的 haxm 安装程序 ram size.Follow 下面提到的步骤。

如果你在默认位置安装 android studio 那么你可以在这个位置找到 haxm 安装程序 'C:\Users\Niyamat\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager'

转到此位置(确保将 userName Niyamat 更改为您的用户名)。单击 "intelhaxm-android" 和 运行 it.Then 弹出一个警告对话框,如下所示 click yes.Then click Next.And finally click Set manually.and remove 512 and add 1024.Something like this .然后单击下一步,然后 install.Wait 几秒钟 install.And 即 it.I 认为现在您可以 运行 您的应用程序在您的虚拟设备上。 希望对您有所帮助!