Emulator: emulator: ERROR: x86_64 emulation currently requires hardware acceleration - android

When I try to run my Hello application , the emulator gives this message. What is the sulotion?
This is the emulator view unfortunately.
Error
31/08/2018
16:32 Gradle sync started
16:32 Project setup started
16:32 Gradle sync finished in 3s 187ms (from cached state)
16:34 IDE and Plugin Updates: Android Studio is ready to update.
16:35 * daemon not running; starting now at tcp:5037
16:35 * daemon started successfully
16:35 Executing tasks: [:app:assembleDebug]
16:35 Emulator: emulator: ERROR: x86_64 emulation currently requires
hardware acceleration!
16:35 Emulator: Process finished with exit code 1
16:35 Gradle build finished in 27s 847ms

Boot into bios and enable VTX. This allows the emulator to use hardware virtualization.

As can be seen in your error-output, running an emulator x86_64 emulation currently requires hardware acceleration!.
What does this error mean/where does it come from?
Emulations run in a virtualized thread of your CPU. A CPU normaly got several physical cores (e.g. in QuadCore CPUs there are 4 physical cores). Virtualization furthermore subdivides these cores into multiple "virtual" cores, meaning it simulates more phyisical cores. You can read more information elsewhere on the internet. Here an extract from geek-university which sums it up pretty short to the point:
CPU virtualization involves a single CPU acting as if it were multiple
separate CPUs. The most common reason for doing this is to run multiple different operating systems on one machine. CPU
virtualization emphasizes performance and runs directly on the
available CPUs whenever possible. The underlying physical resources
are used whenever possible and the virtualization layer runs
instructions only as needed to make virtual machines operate as if
they were running directly on a physical machine.
When many virtual machines are running [...], those [...]
might compete for CPU resources. [...].
Emulators need this environment due to the highlighted reason: Its emulating an entire other system - In your case an Android smartphone.
Solution
Regarding you have an Intel-CPU (AMD should be somehow analog), this should solve your problem.
As general note (this seems to be solved in OPs question since its not in the error log): Make sure Intel x86 Emulator Accelerator (HAXM installer) is installed in your Android SDK (check under Settings -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools)
Also as note if somebody wants to check if he has OPs problem coming from a more generic error: Run this command in the command line (needs Android SDK Command-line Tools (latest) to be installed in your SDK):
C:\Android\YourApp> C:\Users\{Username}\AppData\Local\Android\Sdk\emulator\emulator.exe -avd YourAVDName -netspeed full -netdelay none
# The First is your path to your SDKs emulator.exe; use the path you installed the SDK in
# -avd needs a name of an existing AVD you set up in the AVD Manager in Android Studio.
The possible outcome is (if HAXM is already installed and hardware acceleration is your poblem):
emulator: Android emulator version 30.5.3.0 (build_id 7196367)
(CL:N/A) handleCpuAcceleration: feature check for hvf emulator: ERROR:
x86_64 emulation currently requires hardware acceleration! CPU
acceleration status: VT feature disabled in BIOS/UEFI More info on
configuring VM acceleration on Windows:
https://developer.android.com/studio/run/emulator-acceleration#vm-windows
General information on acceleration:
https://developer.android.com/studio/run/emulator-acceleration.
Note that I used an AVD with x86_64 here.
To solve the error you have to restart your PC and enter your BIOS. Search for you CPU-preferences (can often be found in an Advanced-options tab). Somewhere there you'll find a setting called Intel Virtualization Technology which presumably is disabled. enable and restart your computer.
Now your AVD should work fine.

Related

Android studio's emulator doesn't start

7:45 PM Emulator: Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.
7:45 PM Emulator: emulator: ERROR: x86 emulation currently requires hardware acceleration!
7:45 PM Emulator: CPU acceleration status: Unable to open HAXM device: ERROR_FILE_NOT_FOUND
7:45 PM Emulator: Process finished with exit code 1
Couple things could be going on here. first off Im assuming you're not running it in some virtual environment so few things you could try
The issue might be your CPU hardware, if you have like a core 2 duo processor or something along the low lines like that then it probably does not support Extended Page Tables and Unrestricted guest(thats your EPT + UG error) try running on an API lower than 21 and see if it works you will still get warnings but it should work if that the case
if that isn't the case see if intel virtualization technology is turn on in your bios
try updating your HAXM(hardware accelerated execution manager) on your computer using resource file from the official site(software.intel.com) or whatever it is
or if you don't even have HAXM you can try installing it....
Installation of Intel HAXM consists of two steps. First, you need to download it using SDK manager. Then you need to run intelhaxm-android.exe to install Intel HAXM
also would help to know what kind of processor/cpu you have
Found a few links for the warnings:
For the first warning: Quick Boot not supported
For the others: HAXM errors
Install HAXM from "...sdkroot/ extras / intel" folder .Open the file 'intelhaxm-android.exe'
from this folder.If you don't have it download it.
Reverting back to 7.1 version of HAXM driver worked for me.
the rest are all warnings, so my Emulator showed up finally!!!
Thank you all for guiding.

Cordova black screen cold boot

I am trying to run "cordova emulate android" on the default hello cordova project, however when I run it I get an alert saying "cold boot: snapshot doesn't exist", and the emulator screen simply stays black. Here is the terminal output:
BUILD SUCCESSFUL in 3s
47 actionable tasks: 1 executed, 46 up-to-date
Built the following apk(s):
/home/marc/Documents/Tests/cordova/hello/platforms/android/app/build/outputs/apk/debug/app-debug.apk
ANDROID_HOME=/home/marc/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
No emulator specified, defaulting to test
Waiting for emulator to start...
emulator: Requested console port 5584: Inferring adb port 5585.
emulator: WARNING: Host CPU is missing the following feature(s) required for x86 emulation: SSSE3
Hardware-accelerated emulation may not work properly!
emulator: WARNING: Not all modern X86 virtualization features supported, which introduces problems with slowdown when running Android on multicore vCPUs. Setting AVD to run with 1 vCPU core only.
warning: host doesn't support requested feature: CPUID.01H:ECX.ssse3 [bit 9]
emulator: WARNING: Not saving state: emulator hasn't finished booting.
How can I fix this?
P.S. I am using andorid api version 26 on Ubuntu 16.04.3 LTS
I answered a question similar to this here. Quickly: The issue might be your CPU hardware. Certain AVD Google API levels do not run well on CPUs that do not support certain features; in your case 'SSSE3'. Try an older AVD Google API level <= 20.

Android Studio not launching an emulator

When i am trying to run Android code in Android Studio it shows the following in the event log. But I'm not getting any output and am unable to open the emulator.
Executing tasks: [:app:assembleDebug, :app:assembleDebugAndroidTest]
7:28:43 PM Gradle build finished in 4s 386ms
7:30:24 PM Executing tasks: [:app:assembleDebug]
7:30:27 PM Gradle build finished in 3s 576ms
When I am trying to run from AVD Manager it shows as follows:
Cannot launch AVD in emulator.
Output:
emulator: WARNING: VM heap size set below hardware specified minimum of 384MB
emulator: WARNING: Setting VM heap size to 384MB
emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: Android Emulator requires an Intel processor with VT-x and NX support.
Your CPU: 'AuthenticAMD'
When this type of problem happens, best way is to make sure you have followed below points correctly.
You have proper SDK installed
You have Intel HAXM & virtualization option enabled in your BIOS
Configure emulator correctly, download the Intel X86 Atom system image for better performance.
User arm instead of x86 if you have AMD processor when creating emulator.(In most of case)
When you created your device you should have used arm instead of x86. It must work
I'd recommend using Visual Studios Android Emulator
It is stand-alone, so you dont need Visual Studio to run it, it boots up in seconds, and is more robust then GenyMotions Android Emulator.
Launch your emulator from VS Android emulator, once the OS boots and the homescreen displays run your code and it will give you an option to choose the VS emulator in android studio.
Download latest version of Haxm and enable it in bios (hardware acceleration), on most computers it is basically turned off

HAXM Hardware Requirements

Do i need to upgrade my processor to run HAXM or have i missed something? If i have missed something, any hints would be greatly appreciated :)
My processor is Intel Core2 6300 # 1.86GHz 1.86GHz installed memory 4.00 Gb. Running on Win7.
I have enabled VT in the BIOS, but it is for 16 and 32 bits? Is this a problem?
I have run the intel processor identification utility, file pidenu39.msi from ...
Intel® Processor Identification Utility - Windows* Version
It tells me on the CPU Technologies tab that my processor does have Intel Virtualization Technology, but does not have VT-x Virtualization Technology with Extended Page Tables. Is this OK?
From this website , Configuring Virtual Machine Acceleration
i have followed all of the instructions under this heading ...
Configuring VM Acceleration on Windows
sc query intel haxm does indicate that the virtualization driver is operating correctly.
I am running the newest version of Android Studio. I am running the very simple Hello Android app from the Android Application Devekopment for Dummies book, chapter 3. Nothing complex or messy here :)
I get this message sequence ...
C:\AndroidSDK\tools\emulator.exe -avd Nexus_5_API_21_x86 -netspeed full -netdelay none
emulator: device fd:584
**HAX is not working** and emulator runs in emulation mode
emulator: The memory needed by this VM exceeds the driver limit
.
emulator: warning: opening audio input failed
creating window 39 53 300 532
../../sdk/emulator/opengl//host/libs/Translator/GLES_V2//GLESv2Imp.cpp:glAttachShader:156 error 0x501
../../sdk/emulator/opengl//host/libs/Translator/GLES_V2//GLESv2Imp.cpp:glAttachShader:156 error 0x501
Followed by many more error 0x501s
Just a note, but if you want to change the amount of ram that HAXM has available you can re-run the installation and it will allow you to alter the setting.
I found this out by accident when I was trying to update HAXM. The last page of the install tells you that you can change the setting by re-running install.
How much RAM is set for use inside your AVD configuration ? this number has to be lower or equal to the memory usage you have set during the installation of HAXM.
If I am not wrong you are using Android Studio, and there is an option for RAM size when creating virtual device from AVD , please read this, Managing AVDs with AVD Manager
Also, the default ram size is 96 megabytes.
I had the same problem with a similar processor, core i3, in my VAIO laptop. VT was also enabled on the BIOS and the problem was fixed when I uninstalled the avast anti-virus(no disabling the protection) and so I could finish the HAMX installation. After that, I installed the Avast software again.
I hope this issue can help more people.

Android emulator: how to find out if hardware virtualization feature is used?

Starting with Android SDK Tools rev 17 the Android emulator supports using the hardware virtualization feature (Intel VT, VT-x, vmx and AMD-V, SVM) which should speed-up x86 based emulator images a lot: http://developer.android.com/guide/developing/devices/emulator.html#accel-vm
I installed all necessary components:
The newest SDK tools
The Intel Hardware Accelerated Execution Manager (and installed it by executing IntelHaxm.exe)
Intel Atom x86 System Image (available as API 10 and API 15 image)
Then I created a new AVD using that image, but I could not "feel" any difference regarding the execution speed.
Therefore my question is: How to find out if hardware virtualization feature is used?
And if not what needs to be done to use it?
I know that it is enabled by the BIOS, because I can run Windows 64 bit VMs in VirtualBox.
Additionally I have verified it using the Microsoft® Hardware-Assisted Virtualization Detection Tool.
During emulator loading you should see this line:
[2012-03-26 14:06:22 - Emulator] HAX is working and emulator runs in fast virt mode
After steping through this tutorial on OS X Lion, I see the following in the console, when starting the emulator:
./emulator-x86 -avd Test3
HAX is working and emulator runs in fast virt mode
Had the same issue on Windows 7 32bit with Q6600 Intel processor and pretty outdated Asus P5E-VM SE motherboard.
The motherboard did not even have a switch for virtualization, though Intel tool:
http://www.intel.com/support/processors/tools/piu/sb/CS-014921.htm
indicated that VT technology is enabled.
The culprit was that Data Execution prevention was enabled only for windows services, I have enabled it for all programs and after computer restart received this message in the Android Console of the Eclipse:
HAX is working and emulator runs in fast virt mode
DEP setting is located:
Located Windows/Control Panel/System&Security/System/Advanced System Settings/Advanced tab/Performance/Data Execution Prevention tab
The idea to check it I received here: https://developer.tizen.org/sdk/haxm
Though only used standard images (not Tizen ones).
Have to say that loading of the emulator in the virtualization mode is not nearly as impressive as on Intel promo video: http://www.youtube.com/watch?v=pt9IeJ777zw
But uploading of the application (mine is pretty big ~5MB) and general responsiveness of the emulator is quite significant. One cannot say that it works as native computer (that it sometimes there is a visible lag), but again it is visibly faster.
It eats a lot of memory though (I have 4 GB, only 14MB is free when emulator will run).
A quick solution for Windows platform, Launch CMD as an administrator and type this command
SC query INTELHAXM
And you should see output like this (if hardware acceleration is up and running)
SERVICE_NAME: intelhaxm
TYPE : 1 KERNEL_DRIVER
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0

Categories

Resources