可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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.
At 4:Run
Error while waiting for device: The emulator process for AVD Nexus_5X_API_25 was killed.
AT Gradle Console:
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
System Config :
Macbook Pro 2016
OS: High Sierra
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 unknown, screens 1680x1050; Retina
回答1:
I had the same problem. All I did to solve it was updating Android Emulator and Intel x86 Emulator Accelerator under Android SDK Manager > SDK Tools. It started to work again.
回答2:
Official Solution from Google issue tracker.
SOLUTION A
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 - If HAXM installed in Android Studio, uninstall it;
- Go to SDK Manager > SDK Tools (or Appearance & Behaviour > System Settings > Android SDK)
- Uncheck Intel x86 Emulator Accelerator (HAXM Installer) and Apply. This will uninstall HAXM.
A2 - You might need to first install HAXM in order to get HVF to work.
A3 - Check whether your macOS supports Hypervisor.Framework or not:
A4 - Find the file "advancedFeatures.ini". It may be placed in;
~/.android/advancedFeatures.ini ( Users/<username>/.android/advancedFeatures.ini) or /Users/<username>/Library/Android/sdk/emulator/lib/advancedFeatures.ini (I found mine here)
A5 - Open "advancedFeatures.ini" with an editor.
- Find the line
HVF = off. Change off to on; "HVF = on"
A6 - Restart Android Studio if it is open (Restart the computer if necessary). Create and RUN the emulator :) No more HAXM warnings :)
SOLUTION B
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/