AVD Emulator is not working in Android Studio - android

While running the emulator on the android studio, my Event Log:
17:11 Executing tasks: [:app:assembleDebug]
17:11 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.
17:11 Emulator: Warning: requested RAM 1536M too high for your system.
Reducing to maximum supported size 512M
17:11 Emulator:
C:\Users....\AppData\Local\Android\Sdk\emulator\qemu\windows-x86\qemu-system-x86_64.exe:
Could not load library WinHvPlatform.dll.
17:11 Emulator:
C:\Users....\AppData\Local\Android\Sdk\emulator\qemu\windows-x86\qemu-system-x86_64.exe:
failed to initialize WHPX: Function not implemented
17:11 Emulator: Process finished with exit code 0
17:11 Gradle build finished in 2 s 704 ms
All the bold sentence were shown in RED color.
I am getting Notification as:
Emulator:
C:\Users....\AppData\Local\Android\Sdk\emulator\qemu\windows-x86\qemu-system-x86_64.exe:
failed to initialize WHPX: Function not implemented
My SDK Platform:
My SDK Tools:
I tried to solve the issue with reference: https://stackoverflow.com/a/52587220/7678788 (I was unable to change it) so, I took help of https://stackoverflow.com/a/52342344/7678788, but this also didn't solve the issue.
My SDK Platform and SDK Tools are of the latest version.
How to fix this issue?
UPDATE
I have also installed the latest Intel x86 Emulator Accelerator (HAXM) and tried to run the emulator, my Event Log:
19:11 Executing tasks: [:app:assembleDebug]
19:11 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.
19:11 Emulator: Warning: requested RAM 1536M too high for your system.
Reducing to maximum supported size 512M
19:11 Gradle build finished in 8 s 357 ms
19:11 Emulator: Process finished with exit code 0
All the bold sentence were shown in RED color.

While it's true that the emulator (The emulator ONLY) ask 512mb of ram as minimum, that isn't recomendable since your system, the android studio, and background process also take ram, to run android studio i'll suggest having at least 4gb of ram, but if that isn't posible you should try to have at least arround 768mb of free ram before running the emulator.
For reference there are some OS ram usage(all on x64 OS)
Windows 7 : 460mb - 540mb
Windows 8 : 1.8gb - 2.4gb
Windows 10 : 1.5gb - 2.5gb

Try installing the Intel x86 Emulator Accelarator (HAXM) and reboot the device. Make sure the emulator is installed properly and reboot Android Studio.

Related

Getting error while running program on Android Studio

I am running program on Android Studio and getting below error. Can you please help:
20:14 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.
20:14 Emulator: Warning: requested RAM 1536M too high for your system. Reducing to maximum supported size 512M
20:14 Emulator: C:\Users\dell\AppData\Local\Android\Sdk\emulator\qemu\windows-x86\qemu-system-i386.exe: Could not load library WinHvPlatform.dll.
20:14 Emulator: C:\Users\dell\AppData\Local\Android\Sdk\emulator\qemu\windows-x86\qemu-system-i386.exe: failed to initialize WHPX: Function not implemented
While installing Android studio you might've set the size of RAM for your Emulator to 1536MB which is high, as mentioned in the Warning.
Please follow this answer to reduce the Allocated size for Emulator.
If you have a RAM of 4GB on your system (I'm guessing it, because you got this warning), please run the app on your physical phone itself, instead of the Emulator.
Another option is to use: Intel x86 Emulator Accelerator (HAXM installer) which might / might not help you.

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

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.

Emulator not working: "CPU with EPT + UG needed"

I'm new to Android Studio, this is my first attempt at running an app. My computer is relatively slow and can't run HAXM so I'm using the ARM instead of the x86 build for the emulator. When I try running it, I get this error:
21:31 Gradle build finished in 15s 887ms
21:31 Emulator: WARNING: init: Missing WGL extension WGL_ARB_create_context
21:31 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.
21:31 Emulator: emulator: WARNING: UpdateCheck: Failure: Error
21:32 Emulator: Process finished with exit code -1073741819 (0xC0000005)
I've tried following instructions from multiple questions on this site, but nothing has worked for me so far. Is there a way to run the emulator or is it just not compatible with my computer? Thanks.
The issues have to do with the specific device you're trying to emulate and the processor you have (intel core 2 or older)
To solve it:
Create a new emulator
Select the device you would like to emulate.
On the next page with the header "System Image" select the tab "other images"
Download and select an image that is listed as armeabi-v7a under the ABI column.
That image should run successfully with your processor.

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

Categories

Resources