Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emulator not starting after updating to Android Studio

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.

  • Restart and reinstall HAXM installer.

  • Restart and reinstall AVD manager.

  • Start emulator from terminal.

  • Change the size of RAM to 2GB.

  • Graphics to Software GLES 2.0

    PFB the logs.

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

like image 789
Nizamudeen Sherif Avatar asked Oct 27 '17 18:10

Nizamudeen Sherif


2 Answers

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.

Screenshot here

like image 128
Jan Avatar answered Oct 19 '22 09:10

Jan


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.

  • Install standalone Intel HAXM as a regular .dmg install. Download from here: https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm

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

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

  • If above not work.Try

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

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

  • $ sysctl kern.hv_support

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

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/

like image 42
Nizamudeen Sherif Avatar answered Oct 19 '22 11:10

Nizamudeen Sherif