更新到 Android Studio 后模拟器无法启动 [英] Emulator not starting after updating to Android Studio

查看:67
本文介绍了更新到 Android Studio 后模拟器无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已通过标准更新渠道将 android studio 更新到 3.0.更新后无法启动模拟器.

I have updated android studio to 3.0 through standard update channel. After update am not able to start the emulator.

我尝试了以下方法.但没有任何效果.

I have tried the following. But nothing worked.

  • 重新启动并重新安装 HAXM 安装程序.

  • Restart and reinstall HAXM installer.

重新启动并重新安装 AVD 管理器.

Restart and reinstall AVD manager.

从终端启动模拟器.

将 RAM 大小更改为 2GB.

Change the size of RAM to 2GB.

图形到软件 GLES 2.0

Graphics to Software GLES 2.0

PFB 日志.

在 4:Run

Error while waiting for device: The emulator process for AVD Nexus_5X_API_25 was killed.

AT Gradle 控制台:

27/10/17
8:42 PM Gradle sync started

8:42 PM Project setup started

8:42 PM Gradle sync finished in 3s 25ms (from cached state)

8:42 PM adb E 10-27 20:42:34   953 34293 usb_osx.cpp:152] Unable to create an interface plug-in (e00002be)

8:43 PM Executing tasks: [:app:assembleDebug]

8:43 PM Emulator: Failed to open vm 7

8:43 PM Emulator: Failed to create HAX VM

8:43 PM Emulator: No accelerator found.

8:43 PM Emulator: failed to initialize HAX: Invalid argument

8:43 PM Emulator: Process finished with exit code 0

8:43 PM Gradle build finished in 19s 741ms

系统配置:

Macbook Pro 2016

Macbook Pro 2016

操作系统:High Sierra

OS: High Sierra

版本:3.0,AI-171.4408382,201710201707,

Build: 3.0, AI-171.4408382, 201710201707,

AI-171.4408382,JRE 1.8.0_152-release-915-b08x64 JetBrains s.r.o,OS Mac OS X(x86_64) v10.13 未知,屏幕 1680x1050;视网膜

AI-171.4408382, JRE 1.8.0_152-release-915-b08x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.13 unknown, screens 1680x1050; Retina

推荐答案

来自 Google 问题跟踪器的官方解决方案.

Official Solution from Google issue tracker.

解决方案 A

HVF 解决方案:使用 Hypervisor.Framework 在 Canary 频道 26.1.x(推荐 API 25/26)上运行模拟器我实施了这个解决方案并且它奏效了.我现在在 macOS High Sierra 上使用模拟器.

HVF Solution: Running the emulator on Canary channel 26.1.x (API 25/26 recommended) with Hypervisor.Framework I implemented this solution and it worked. I am using emulator now on macOS High Sierra.

A1 - 如果 HAXM 安装在 Android Studio 中,请将其卸载;

A1 - If HAXM installed in Android Studio, uninstall it;

  • 转到 SDK 管理器 >SDK 工具(或 Appearance & Behavior > System设置 >Android SDK)
  • 取消选中 Intel x86 Emulator Accelerator(HAXM 安装程序)并应用.这将卸载 HAXM.

A2 - 您可能需要先安装 HAXM 才能使 HVF 工作.

A2 - You might need to first install HAXM in order to get HVF to work.

OS X 上的 HAXM 不断消失.无论出于何种原因,您都可以通过

HAXM on OS X keeps on disappearing. For any reason, you can uninstall standalone HAXM installation by

sudo 库/扩展/intelhaxm.kext/Contents/Resources/uninstall.sh

如果以上不行,试试

sudo System/Library/Extensions/intelhaxm.kext/Contents/Resources/uninstall.sh

A3 - 检查您的 macOS 是否支持 Hypervisor.Framework:

A3 - Check whether your macOS supports Hypervisor.Framework or not:

  • $ sysctl kern.hv_support

kern.hv_support: 1(如果支持=1,如果不支持=0)(应该支持实施 HVF 解决方案)

kern.hv_support: 1 (if support =1, if not support = 0) (should support to implement HVF solution)

A4 - 找到文件advancedFeatures.ini".可以放在;

A4 - Find the file "advancedFeatures.ini". It may be placed in;

  • ~/.android/advancedFeatures.ini (Users//.android/advancedFeatures.ini)
  • /Users//Library/Android/sdk/emulator/lib/advancedFeatures.ini(我在这里找到的)
  • ~/.android/advancedFeatures.ini ( Users/<username>/.android/advancedFeatures.ini) or
  • /Users/<username>/Library/Android/sdk/emulator/lib/advancedFeatures.ini (I found mine here)

A5 - 打开advancedFeatures.ini";与编辑.

A5 - Open "advancedFeatures.ini" with an editor.

  • 找到行 HVF = off.改开;HVF = 开"
  • Find the line HVF = off. Change off to on; "HVF = on"

A6 - 如果 Android Studio 处于打开状态,则重新启动它(必要时重新启动计算机).创建并运行模拟器 :) 不再有 HAXM 警告 :)

A6 - Restart Android Studio if it is open (Restart the computer if necessary). Create and RUN the emulator :) No more HAXM warnings :)

解决方案 B

我没有尝试这个解决方案,但有几条评论声称它也有效.您也可以尝试此操作,请按照此处的说明操作:https://blog.celogeek.com/201708/672/android-studio-emulator-haxm-on-mac-os-high-serria-10-13/

I didn't try this solution but several comments claim that it also worked. You can try this also, follow the instructions from here : https://blog.celogeek.com/201708/672/android-studio-emulator-haxm-on-mac-os-high-serria-10-13/

这篇关于更新到 Android Studio 后模拟器无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆