1

When I try to run my Hello application , the emulator gives this message. What is the sulotion? This is the emulator view unfortunately.

enter image description here

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

John Joe
  • 12,412
  • 16
  • 70
  • 135
hassan
  • 11
  • 6
  • 1
    Possible duplicate of [AMD Processor Hax Kernel is not installed](https://stackoverflow.com/questions/29059977/amd-processor-hax-kernel-is-not-installed) – Markus Kauppinen Aug 31 '18 at 12:26
  • 1
    Possible duplicate of https://stackoverflow.com/questions/29136173/emulator-error-x86-emulation-currently-requires-hardware-acceleration – rut_0_1 Aug 31 '18 at 12:26

2 Answers2

0

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

0

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.

Markus
  • 2,265
  • 5
  • 28
  • 54