Android VM: Can avd run on a host with Hyper-V? - android

I have this issue trying to run a virtual android device on my computer which runs Hyper-V because I use docker containers. The host s.o. is Windows 10 Pro. Android Studio installed, and its updates.
When I try to run a virtual device a blue screen shows and system restarts.
I want to start learning Flutter but I'm stuck in this.
Any solution / Work around?

From the Android developer's blog, you'll want to ensure your hardware and software are supported and versions are current.

Blue screen errors can be happened because of a hardware or driver errors. Please take a picture of the error and send it to us. But a general solution is to open device manager (devmgmt.msc) then check if there is a yellow sign on a driver or not. Please check if all of the drivers has been installed properly. After that, You should check if Intel virtualization technology is turned on in BIOS system

Related

cannot run emulator in android studio and in genymotion

I was installed android studio, and when I Run my first App I found this note "your CPU doesn't support Vt-x"
so I can't run my App
when I used new images instead of an x86, my App is Run But the emulator Start and close very fast by himself, the screen of the emulator closed very quickly
what is wrong?
also, I try to run with 'Genymotion', also it doesn't Run, still with the white Screen-like image below
please help me, I would Run my Android emulator how?
VT-x is known as virtualization hardware extensions in BIOS.
This is the security issue handled from BIOS. You just need to enable the VT-X from BIOS of your computer. Instead you have nothing to do from android studio or genymotion.
You can see this answer.
You can also check the way of doing such thing from this blog, though this steps may vary in your BIOS.

Is it possible to run Android Device Emulator (via Android Studio 2) on VMWare?

I have been running Android Studio 1.5.1 doing development on a WMWare copy of Windows 2012 R2 and everything works fine. I've been able to run the device emulator with no problems and start various versions of Android running in AVD.
Android Studio 2.x Change
I recently installed Android Studio 2.0 (see image below for exact version).
Now when I attempt to run the emulator nothing happens.
Well, actually I do see a message in the status bar of Studio when I attempt to start the device, but then that message disappears and nothing happens after that.
There is a warning that I need to turn off Hyper-V (see image below), but I don't believe that is possible since this is a VM.
No Longer Possible?
Is it not possible to run the emulator on the VM any more?
More recent versions of the Android Emulator require hardware virtualization support (Intel HAXM).
Unfortunately, most virtual machines do not provide HAXM instructions to the guest (a VM within a VM), so you will be unable to use the emulator within the virtual machine.
I just installed Android Studio 2.1 on my Windows 2008 R2 VM (running VMWare) and I'm happy to report that it is possible to run ARM based AVD (Android Virtual Devices) on the VM.
Steps To Run Arm-based Virtual Device on VMWare
Go to location where you've installed the Android SDKs (in my case it is at %appdata%\Android2\SDK\
If you are in the right place you should see a directory structure and directories like the ones shown in the first image below.
Start the AVD.exe by double-clicking it.
You will see a window like the one in the image below
Take a close look and notice that this is running an ARM(armeabi-v71) image. When you download images you have to download ARM-based images. (no x86 images will work on VM).
Also, you cannot start these images from AVD that launches from Android Studio 2.x
Make sure you have an environment variable named ANDROID_SDK_HOME set to path which is similar to the one at the top of the AVD manager (in image).
Once you do all of this and start an ARM-based image on a VMWare VM it will warn you that it is faster with HAXM but at least the image will run.
Finally, you can see if you attempt to launch your Virtual Device from the AVD Manager in Android Studio then it will warn you that Hyper-V needs to be turned off. Of course you cannot turn Hyper-V off on a VM.
EDIT -- Running Android 7 ARM Image
#mcflysoft asked about running an android 7 ARM image. At first I didn't think it worked, but if you open up your SDK manager and install the exact ARM OS image shown in the following picture, it will run on a Windows VM:
ARM image Containing Google APIs
I tried installing the ARM image that contained the Google APIs and that one would not ever start. There were failures logged which I could see in c:\> adb shell logcat.
Beware : It Is Really Slow
However, running Android 7 seems extremely slow and I don't see a web browser.
Not sure how helpful it may be to you, but you can get it working.
Good luck.
The simplest solution I've found so far is to use a device farm, for example Samsung's device farm:
https://developer.samsung.com/remotetestlab/galaxy/rtlDeviceList.action#444
It's free to use and you can deploy your apps just like in an emulator (Right Click -> Test -> Remote Debug Bridge -> follow the instructions).
And since those are real devices, the speed might be even better than on an emulator on your personal PC.
I've had the same problem so I'll post an answer in the hope that someone might find this useful in the future. I can run Android Studio in my VM but when I try to start up an emulator, I can't download an image due to "Your CPU does not support required features (VT-x or SVM)"
Although I didn't get a virtual device up and running, I got round the problem by using BlueStacks. You install BlueStacks on the VM. BlueStacks (at the moment) runs Android 7.1.1, SDK 25. Inside BlueStacks, go to Settings/Preferences and Enable Android Debugger Bridge (adb) following this set of instructions. Then you should be able to run your app on BlueStacks from inside Android Studio. Logcat can see any log statements from BlueStacks.
The alternative (without enabling the debugger bridge) is to locate the .apk file for your app and then open that with BlueStacks APK installer. Logcat still sees the traces.
It's slow on a VM. You also have to set android:testOnly="false" in your XML file

How should I do to have a fast emulator?

Sorry my bad English.
I installed Android Studio 2.0, and I have problems with the emulator.
When I launch the emulator that I used with Android Studio 1.5.1 appears the windows [A], the emulator is slow
as before but the app works; when in fact I launch a NEW emulator appears to me the window [B], and then appears
no emulator.
WHAT IS HAXM?
How should I do to have a fast emulator?
Regards.
Genymotion makes a pretty good emulator in my opinion. It's way faster than the android studio emulator. Give it a try!
Well don't worry about it. first of all HAXM is a software which makes hardware based virtualization. in simple words it uses your hardware resources to make a virtual device like android device you are talking about.
if you don't have a HAXM software download it and install it and then check if virtualization is enabled or supported in your BIOS settings. press esc or delete whatever the key is to go into bios settings of your computer while computer first starts up. very similar like below.
go to Advanced Bios Features
then look for virtualization if its disabled then enable it otherwise its good to go.
so if you are done with HAXM lets come back to the android studio and start android device manager or AVD and follow the tutorial from android developers page its already answered here. And android emulators are fast now from android studio 2.0 don't worry about it otherwise you can download Genymotion or bluestack
happy coding.

Visual Studio emulator for Android stuck at "OS is starting...", only on API Level 23 / Android 6

Since I read the news about Xamarin now being "free", I immediately installed Visual Studio 2015 Update 2 and the Android tooling (NDKs, SDKs for 19-23, Visual Studio Emulator for Android dated January 2016) to start working on an Android application.
Excited I launched the emulator from Tools -> Visual Studio Emulator for Android and installed the profile that is the best match for my own phone. Since my phone is on Android 6, I decided to get a profile for API Level 23 / Android 6.
Since I had already enabled Hyper-V a few months ago, the installation for the profile only had to add me to the Administrators group and create 2 network adapters.
So far, so good.
Upon starting the emulator, it would stay at "OS is starting...". I figured I'd wait a while. I figured I'd wait a while longer too. After that, I gave up the possibility of it going to work and started investigating.
I also tried other profiles, a few others from API Level 23, one from 22 and one from 19. Only the ones from API Level 23 did not work.
The following steps are what I came up with so far by Googling etc. I tried them in all sorts of combinations:
Rebooting
Disabling / enabling Hyper-V
Removing vEthernet adapters (through the Hyper-V Manager).
Running XDECleanup
Allowing XDE through my Windows Firewall as application (incoming)
Restoring the emulator software in Programs and Features
Enabling / disabling "Processor Compatibility" in Hyper-V Manager.
This is the data I've gathered so far:
A screenshot of the error message that the emulator gives after waiting a long time (10 - 15 minutes, maybe a little longer)
A screenshot of the last part of the log when being connected to the Android 6 VM:
A screenshot of the last part of the log of a working VM (this one's from an Android 4.4 VM):
Responses I've got so far from Microsoft:
-Those errors are normal
-And the only step I've tryed which they told me to, and I don't see here, it's this one:
On Hyper-V Manager, check the option for compatibility under CPU section
Besides from this, just make sure that on Hyper-V you get only 2 switches, the one you use to connect to the internet and the one that the VS Emulator for Android creates, I haven't got any results, but if you try, maybe you will.
In my case, I was mucking around with the VS emulator's virtual switches and had the network adapters in the wrong order.
After I moved the Windows Phone Emulator Internal Switch (Created when first running the VS Emulator) to the first Network Adapter slot in my settings, the emulator started up just fine. Apparently, order matters.
Had the same problem but got mine to work after trying a lot of things from different threads.
In the end I think this did the trick for me:
I added "c:\Program Files (x86)\Microsoft XDE\10.0.10586.0\xde.exe" as an exception in the firewall.
(i also switched of the firewall, but was probably unnecessary)
Temporarly disabled the WiFi device
Uninstalled VirtualBox
Removed all Virtual Switches in Hyper-V
Executed XdeCleanup.exe
Started the emulator again and it started up successfully!
Swiched of the emulator and enabled Firewall, Wifi device.
The emulator still starts successfully every time!
Thanks to all for sharing!
If you're using Xamarin, it's recommended that you use Xamarin Player. It's not Xamarin exclusive, it's just a much faster Android emulator. I use Android Studio, and the Xamarin Player is still faster on boot and launch than the default. This is just my recommendation to you, I have no clue how to fix your Visual Studio emulator, sorry.
I've played a lot with this and realized that I have had manually configured paging file on Windows. After restoring it to default all worked perfectly without messing with the virtual switches or adapters.
Just make sure that you have all Windows memory etc. settings set to default.
Regards, Mladen
My problem was that the system image was missing for the emulator.
When I opened the android virtual device manager it had an exclamation mark next to actions(i had to download the system image via the download link).
I had the same error message. The solution for me was:
Uninstall all emulators in the Visual Studio Emulator for Android
Check in Hyper-V-Manager if there also no instances
Unistall Visual Studio Emulator for Android
Run xdecleanup.exe (C:\Program Files (x86)\Microsoft XDE)
Uninstall Hyper-V from Windows features
Removed virtual ethernet adapters through uninstalling in Device Manager
(be sure to display disabled devices too)
Install Hyper-V from Windows features
Install Visual Studo Emulator for Android again
Download and install your emulator/profile
Run the emulator and have fun :-)
It seems there was a problem with the virtual switches and Hyper-V. The correct settings for the adapter looks like these:
Hyper-V-Manager:
Device Manager:
Network adapter:
Ethernet:
vEthernet (Virtueller Switch: Intel(R) Ethernet Connection (2) I219-LM #2):
vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch):
Emulator network settings:

Android Studio: Hardware Acceleration

This is driving me absolutely crazy and I can't find any help. I'm fairly novice when it comes to emulators, and even more so when it comes to Android Studio. Here's my problem: I installed Android Studio. Downloaded the SDK updates, including the HAXM one, and set up my own AVD. Upon trying to start up my AVD, or even the starter AVD that was already there, I get an error stating that "emulator: ERROR: x86 emulation currently requires hardware acceleration!"
I've done some googling and tried to finish the install of HAXM using the install file in the Android/SDK folder. I was promptly told that the installation failed and that my CPU didn't allow for Intel Hardware Acceleration, or something like that. I read somewhere that the only way I can use Hardware Acceleration on AMD is if I were on Linux, with which I have no experience with. So I tried giving up. Now I can't figure out how to disable Hardware Acceleration entirely in Android Studio. I haven't even begun learning how to write in android because I can't get an AVD up and running.
Does anyone have any tips for a complete Android noob? I thought this would be something fun to try since I was at once point fairly good with C++ and I have always been a huge fan of android. However, I've avoided doing anything GUI related until now, and I'm not finding it very fun at the moment.
I'm running an AMD system with 8GB of ram. More specifically, I'm using an AMD FX-4130 Quad-Core Processor on a GIGABYTE GA-970A-DS3 Motherboard.
Unfortunately AMD's virtualization technology AMD-V is not compatible with Intel HAXM. Your only choices are to either get familiar with Linux or use a ARM-based AVD, which doesn't require virtualization.
You can find instructions for Linux on Android Developers' document on Using the Emulator.
You can use Genymotion instead of default one. Its faster than the default one. And this emulator is compatible with both Intel and AMD. Genymotion just uses Virtualbox to run Android in VM.
Here's a link to Genymotion .
Genymotion , Genymotion user guide
it may help you.
Take an android phone with its USB cord then follow these steps:
1. plug in phone to computer.
2. on the phone goto: settings>about device scroll to find build number
3. press build number 7x (this enables developer mode)
4. go back to settings press developers options select usb debugging, include bug reports, verify apps via usb, and GPU force rendering.
5. Check for device connection on the computer
6. add in build.gradle under "buildTypes{" write this
debug { debuggable true }
then when you run your project you should be able to see your phone in the avd selection then select it. Your phone will awaken automatically with your application running except it will be a little semi-efficient boot process.
Also do not forget to remove the debug code from your gradle file when you app is finished.

Categories

Resources