Thinc. First Code Android (Part I.5: Setting up Android Virtual Device)

Samuraiwarm
Thinc.
Published in
4 min readSep 30, 2018

⚠️ If you have Docker for Windows that requires Hyper-V to be enabled. Unfortunately, AVD can’t run with Hyper-V enabled. I have encountered this problem myself, but my work requires Docker, so I decided to not use AVD.

There may be errors in your computer after setting up AVD, but don’t worry, I will discuss in this part as well. But before we start fixing the problem, we can set up the AVD right away. You don’t need to set that up again even if your emulator can’t run at first.

On your top-right corner, click “AVD Manager”. This window will show up.

You can choose any devices you want here. I recommend the devices around the top of the list.

Choose your Android version here. It shouldn’t affect your app display for simple apps. For the downloading page purpose, I’m going to choose Pie. 😻

More downloads. It doesn’t end here, probably 🍭

No need to change anything here. Then you’re done!

Try running your app with your app here and see if it works or not.

…and it didn’t work for me. As expected. 🎉

If you don’t have any problems running your app, you’re done now! 🎉

If you do have problems, it takes some extra setups, so let’s get going!

✏️Unfortunately, I only have Windows, and this solution is for Windows only. If you are using Mac or Linux, I didn’t expect any problems to happen. But if you still have the problem, I can’t really help you but to recommend you to google the error. Sorry 😿

First, go to File > Settings… Then search for “sdk” here, and go to the SDK Tools tab.

Install Emulator Accelerator (HAXM), and you will see this popup. Install it, and grant admin permission.

No need to do anything here.

If your installation is completed, which mine didn’t, try running the emulator again. If it doesn’t work, try restarting Android Studio.

If your installation failed with an error like below, we will need an extra setup. Reboot is required during this step, so please open this in somewhere else other than this computer.

📔 The problem is, your computer either doesn’t have Intel Virtualization Technology (VT-x) enabled, or Hyper-V is enabled. We need to setup these.

Failed to install Intel HAXM. For details, please check the installation log: "C:\Users\Samuraiwarm\AppData\Local\Temp\haxm_log1007.txt"
HAXM installation failed. To install HAXM follow the instructions found at: https://software.intel.com/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-windows
Installer log is located at C:\Users\Samuraiwarm\AppData\Local\Temp\haxm_log1007.txt
Installer log contents:
=== Logging started: 30/09/2018 10:28:30 ===
This computer does not support Intel Virtualization Technology (VT-x) or it is being exclusively used by Hyper-V. HAXM cannot be installed.
Please ensure Hyper-V is disabled in Windows Features, or refer to the Intel HAXM documentation for more information.
=== Logging stopped: 30/09/2018 10:28:31 ===

Go to Start > Turn Windows features on or off, and you will see this window. Then, disable Hyper-V in your computer. It will ask you to restart your computer.

woof

If you already have it disabled, restart it anyway. We will enable Intel Virtualization Technology by entering BIOS setting. At the time your computer starts up, enter the system BIOS. You will need to google how to enter BIOS, which is different from every computers.

Find the processor setting, then enable Intel Virtualization Technology. See the official support here.

After this, try re-installing HAXM. This should be working now. 🎉

If it still doesn’t work, please let me know in the comments, and try to google the error if possible. Good luck!

🔗Extra links:

--

--