I am getting below error:
emulator: ERROR: Unfortunately, there's an incompatibility between
HAXM hypervisor and VirtualBox 4.3.30+ which doesn't allow multiple
hypervisors to co-exist. It is being actively worked on; you can find
out more about the issue at http://b.android.com/197915 (Android) and
https://www.virtualbox.org/ticket/14294 (VirtualBox) Internal error:
initial hax sync failed
While it say work is under going, I can run studio on my collegue's machine with same OS(WIN 7), and same machine specs.
Is there a work around this issue currently ?
I received the follow error:
ERROR: Unfortunately, there's an incompatibility between HAXM
hypervisor and VirtualBox 4.3.30+ which doesn't allow multiple
hypervisors to co-exist. It is being actively worked on; you can find
out more about the issue at http://b.android.com/197915 (Android) and
https://www.virtualbox.org/ticket/14294 (VirtualBox)
To solve this problem I only needed to close Docker on Mac.
I had the same problem. While researching I found out about this https://forums.docker.com/t/cant-using-docker-for-mac-with-android-emulator-haxm/8939/3
Apparently, Docker and Android emulators using HAXM cannot run together. I had Docker running in my system. I stopped it and the emulator was able to run without a problem.
If you have Docker installed and running, stop it and try again.
I was trying to emulate an Ionic 1 app on an Android emulator with ionic emulate android -lcs and encountered the same error:
emulator: ERROR: Unfortunately, there's an incompatibility between HAXM hypervisor and VirtualBox 4.3.30+ which doesn't allow multiple hypervisors to co-exist. It is being actively worked on; you can find out more about the issue at http://b.android.com/197915 (Android) and https://www.virtualbox.org/ticket/14294 (VirtualBox)
Failed to sync vcpu reg
Failed to sync vcpu reg
Failed to sync vcpu reg
Internal error: initial hax sync failed
I solved it by saving and suspending execution of all other running VMs with the following steps:
1) Quit Docker for Mac by clicking the whale icon in the top bar and selecting "Quit Docker". I believe this is required because the Docker Daemon (server) of Docker for Mac and Docker Toolbox automatically runs in a Linux VM when the Docker Client is running (you do not need to and cannot run it manually with dockerd or docker daemon). The Docker Client is running when the whale icon is in the top bar.
2) Stop all Vagrant VMs running on the host machine by running vagrant halt, as they may be using Virtual Box as the provider. Check their state changes to Powered Off by running vagrant status.
3) Stop all Virtual Box VMs by running virtualbox to open Virtual Box GUI and then Right-click any VMs and select Close > Save State
4) Close and re-open your Terminal window before retrying
I simply stopped running Docker on Mac.
The emulator then was able to run properly.
You likely have two emulators that are trying to use the same resources on the computer i.e. both the Google one and the Genymotion (VirtualBox) one. Who knows how long/if that will be addressed. If you are running Genymotion you use VirtualBox. So, try to run the Oracle VM Virtual Box Manager and check that no virtual machines are running and shut down any that are. You should be able to run emulators in studio again, just make sure you pick one (Genymotion) or the other (Android AVD manager).
There was an update on the thread that Mehmed found It is not necessary to stop Docker. If you have run all the Android Studio updates, you have the Intel installer already downloaded at Users/your_user/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM_6.1.1.dmg. You need to run the installer yourself.
I had the similar problem and I did the following:
1) Stopped the Docker for mac (Quit)
2) I use 2 monitor (One Mac Screen + Extended another screen), I disconnected the second monitor and it works fine.
In my case (macOS), stop/quit docker does not help. I need to run boot2docker poweroff.
Verify that you don't have more that one Virtual Machine running at the same time.
For Windows Users:
Close all open emulators.
Open Task Manager.
End Process: All instances of adb.exe.
End Process: All processes which has Virtual Box or VBox... in Description.
Restart Emulator.
Related
Uber goal: debug/deploy react-native android application on Windows machine
Problem: When deploying to the emulator react-native run-android fails with > com.android.builder.testing.api.DeviceException: No connected devices!. I tried running adb devices, but that returned no devices. My assumption is that to get this working I need to at least make adb aware of the emulator, and so here I am.
Versions
Windows 10
Version 1703 (OS Build 15063.540)
abd
Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android
Visual Studio Emulator for Android 1.1.622.2
Android OS hosted by emulator KitKat (4.4) API Level 19
Emulated Device 5" screen XXDPI Phone "Similar to Samsung Galaxy S5, Sony"
Setup
Android OS:
Enabled developer mode
Turned on USB Debugging
VM:
2 GBs memory
2 virtual processors
1 Windows Phone Emulator External Virtual Switch
1 Windows Phone Emulator Internal Virtual Switch
Result
adb devices returns that it can't find devices followed by two blank lines:
List of devices attached
<blank line>
<blank line>
What has already been tried/verified
Verified emulator boots
Verified emulator has a network connection and IP address (I can reach internet from emulated android)
Verified I can ping said IP address from the host Win 10 machine
Verified I can find (via adb devices) and deploy (via react-native run-android) to real device attached by USB
Tried forcing adb connection with adb connect 192.168.0.2:5555 and adb connect 192.168.0.2:5554 and received following error:
unable to connect to 192.168.0.2:5555: cannot connect to 192.168.0.2:5555: No connection could be made because the target machine actively refused it. (10061)
Couldn't find remedy for this online
Request for Help
If anyone knows what might be going on and can provide some guidance to resolve, I'd greatly appreciate it. If you need any additional information just ask, and I'll provide it (helpful hints on how to gather it, if non-obvious, would also be appreciated).
Thanks so much for reading this far :)
I was facing similar issue and in my case the setup was like following
Versions
Windows 10 pro Version 1803 (OS Build 17134.165)
Visual Studio Emulator for Android Android
OS hosted by
emulator Marshmallow (6.0.0) (4.4) API Level 24 Emulated Device 5.7"
screen XXDPI Phone "Similar to Samsung Galaxy note4"
In my case I also installed Android Studio which I think it has contributed to the problem by installing SDK under my user folder
C:\Users\[name with space]\AppData\Local\Android\Sdk
Visual Studio also installed Sdk in program files
C:\Program Files (x86)\Android\android-sdk
I decided to move/install android-sdk in c:\Android to avoid issue
Android SDK location should not contain whitespace, as this cause problems with NDK tools
Solution
What I had to do was to consolidate all the Environment variables and Registry entries to point to the right folder
This Stackoverflow question/answer would help in setting registry
'Visual Studio Emulator for Android' devices are not listed in the Android Device Monitor
Then from within visual studio (Tools > Android > Android SDK Manager) open SDK Manager
Go to tools tap and make sure "Android SDK Location" is set to C:\Android\Sdk and also following items are checked
Then in environment variable make sure There is System Environment variable called ANDROID_HOME and the value should also be c:\android\sdk
In my case there was a ANDROID_HOME User Environment which was overriding the system one. Either get rid of that or change it to c:\android\sdk
Once you've updated all these registry and environment variables close all command prompt windows and open a new one (to have environment variables set correctly)
Then check android home by running following command
C:\>echo %ANDROID_HOME%
c:\android\sdk
Also echo %path% and it should have a path pointing to c:\android\sdk\platform-tools and no other paths
Then run adb --version and make sure it is running as c:\android\
and then run
adb kill-server
adb start-server
Once you have done that lunch Visual Studio for Android and run your image of choice. Then adb devices should return the emulator IP address
Extra Resources
There is a good documentation for general troubleshooting the Visual Studio for Android which you can follow for initial troubleshooting:
https://msdn.microsoft.com/en-us/library/mt228282.aspx
I've installed the RTM build of VS2015 with the Android Tools. I can launch the emulator manager and see the list of installed images. When I click the green triangle to start an image, it shows a progress bar and the text "Launching emulator..." and XDE opens up with the message "OS is starting"
After a while, XDE shows an error message:
[Window Title]
Visual Studio Emulator for Android
[Content]
The emulator is unable to connect to the device operating system:
Couldn't set up the UDP port.
Some functionality might be disabled.
[Close]
Strangely, when I look in Hyper-V Manager, the image seems to be running perfectly.
I have already removed the GuestDisplayNameProvider line from xdesku.xml, which was previously resulting in the error: "Failed to read from dev/hw_random: No such device" on startup.
So I finally fixed this issue, it's because I had broken virtual ethernet adapters. Here's what I did to fix it.
Remove Hyper-V through by turning off the windows feature.
Reboot
Open device manager and go to network adapters.
Remove all of the Hyper-V Virtual Ethernet Adapters
Enable Hyper-V through by turning the windows feature back on.
Reboot
Try to run your emulator, you should notice that the Virtual Ethernet Adapters are recreated and working.
This occurred after disabling then re-enabling Hyper-V. To fix the problem:
Delete all virtual switches in Hyper-V Manager, delete all virtual machines in Hyper-V Manager, uninstall all profiles in Visual Studio Emulator for Android. Then reboot the machine (just to be sure). Then, open Visual Studio Emulator for Android, download the profile you want, and then click "play". The relevant switches, VMs, etc will all get created fresh now.
Go to "C:\Program Files (x86)\Microsoft XDE\10.0.10586.0\SKUs\Android\" and open xdesku.xml with notepad and remove the following line: GuestDisplayProvider="VsEmulator.OpenGLGuestDisplay.
If your emulator freezes on "OS is starting" but Hyper-V shows "OS" , follow the following link:
https://stackoverflow.com/a/32006888/948236
It works for me.
Add new virtual switch helped me a lot.
When I'm trying to run my project Xamarin.Android in Hyper-V with Visual Studio 2015 RC (generally speaking, this error/bug or whatever may occur in different VS versions), I'm getting no deploy process to the emulator. However, the emulator has starting successfully, but nothing deployed into it. After closing the emulator, I'm getting this message:
Build Failed: MonoDroid does not support running the previous
version. Please ensure your solution builds before running or
debugging it.
My solution is:
Connect to android device in Hyper-V
Run in terminal "su root"
Run "netcfg" to obtain device ip addrress
Then in ADB command prompt type "adb connect 192.168.1.63"
After this VS/Xamarin begins the deploying process and all working fine.
End :)
Is this a bug OR can Xamarin/Visual Studio deploy applications (for example, android) to the device emulator automatically?
When I run it from the SDK manager, the loading process works, but once it is done, a flash of the emulator appears then quickly disappears.
Sometimes after it loads, nothing happens.
At the worst when it loads, I get the "too many emulator instances are running on this machine. Aborting" message.
I want to start making apps, but this seems to be the only thing stopping me!
I had already turned off Windows Firewall.
pl'z, give me solution
Eclipse Indigo; r12, Windows 7 (64)
The Android emulator uses loopback ports (5554, 5556, etc) to communicate with the external ADB. If it can't do so, it assumes that other emulator instances are occupying these ports.
Failure to do so can be because:
A) Your ports are occupied? Try netstat -an | grep 5554
B) Your loopback interface is not configured - You said you're on Windows - Make sure Windows Loopback is configured (try pinging yourself). (On Linux the same would be achieved by "ifconfig lo", and see. It should be configured, with the right IP (127.0.0.1) and up.
Incidentally, it's MUCH easier to use Android SDK on Linux, because that way both target and host are Linux. Consider running the whole thing in a VM image - and your SDK Experience will be immeasurably easier. From experience.
I also had an error problem ERROR | It seems too many emulator instances are running on this machine. Aborting. in the emulator windows command.
I had a lot of virtual networks, all of which were active, because of the VirtualBox and vmware installation.
Solution: Disabling all those networks solved my problem.
For me, the reason is that I was using wsl-based docker on Windows.
Try disabling the option Use the WSL based engine in the docker settings (which resorts to using Hyper-V)
Enable Hyper-V in Windows Features.
Restart your computer and you should see it work like a charm.
My virtualbox VM, android emulator and docker now works together!
I have Hyper-V enabled (Intel CPU) for use with Docker and WSL2, on Windows 10 21H1.
Returning to Android programming after a hiatus, I reinstalled Android Studio today (4.2). It tried and failed to install HAXM (which is not surprising as it won't work with Hyper-V). I then was unable to open Android virtual devices.
After hunting around for answers (mostly people saying to disable Hyper-V which I was not ready to give up on), I found the exact process command line for the emulator and ran it in an admin window for good measure. Enter the "it seems too many emulator instances are running on this machine" error, previously invisible, which led me here. I checked ports and shouted into the void - nothing helped.
Then I rebooted, on the off chance something in all those attempts was somehow still holding resources (despite killing every related process).
The Android virtual device worked after that reboot, with Hyper-V still active. I hadn't changed anything that should have required a reboot, but evidently some resource(s) were locked along the way in my previous session.
(Also note that if you don't touch/edit \qemu.conf on whatever drive you run from (typically C:) you will see the incorrect Your emulator is out of date error if running from the command line.)
Just enable Hyper-V from Windows features
I'm trying to use Genymotion Android as my android emulator in conjunction with Oracle's VirtualBox Software on my mac. I created a Nexus 5 4.4.2 virtual device that worked a few days ago, but now every time I run Genymotion, I get the following:
Unable to connect to your virtual device! Genymotion will now stop. Check your VirtualBox network configuration.
For more information refer to: https://cloud.genymotion.com/page/faq/#collapse-nostart
I haven't changed anything in VirtualBox over the last few days, and in fact when I open VirtualBox, it shows the virtual device being run in it's preview frame, but I can't get it to run in Genymotion. Any thoughts??
I faced this problem in Ubuntu , it was solved by re installing Virtual Box DKMS kernel module, a similar solution must exist in Mac also.