Android studio unable to view avd - android

hi im new to to android studio and programming.
i wrote a simple hello world program, when i click on run and select the default avd device it gives me the following error
"D:\Users\Brian Fernandes\AppData\Local\Android\sdk\tools\emulator.exe" -avd Nexus_5_API_21_x86 -netspeed full -netdelay none
emulator: WARNING: Requested RAM size of 1536MB is too large for your environment, and is reduced to 1152MB.
Cannot set up guest memory 'android_arm': Invalid argument
Error accepting connection, aborting
i reduced the ram now i get the below error
Cannot launch AVD in emulator.
Output:
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!
i have installed haxm yet its giving me this error
Help me resolve the error.

First reduce the size used by this emulator, or try to use an other emulator system image with minimal config to test your Hello Android application.
I advice you to use an Android powered device later when you get ready and when u're a ninja android developer :)

Personally I've had a lot of problems with AVD emulators. I'd try out genymotion as an alternative. https://www.genymotion.com/#!/ This is what I use for all my android development and it's never given me any errors and is faster than avd.

Reduce the RAM for emulator in between 512 MB to 1 GB.
In a Windows environment you cannot use more than 1 GB of ram for emulator.

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.

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

Android AVD: Not starting OS, Black Screen Only

I formatted my PC, installed Windows 10, SDK and installed API 15 and 23 with build tools. After importing my application into Android Studio I created a new AVD, please see screenshot.
I did not enable Use host GPU and the RAM is set to 1GB, with the HAXM RAM set to 2GB. I double checked the BIOS and Virtualization Settings are enabled. I have run the emulator from the command line using the following command:
emulator -avd Nexus_5_API_15 -netspeed full -netdelay none -debug-init -logcat '*:v'
There were no errors but it does seem to hang at:
emulator: UpdateChecker: skipped version check
I am currently quite frustrated and not sure how to resolve this issue. Can anyone please help.
Thank you guys in advance.
The first time you start the avd it always take a lot of time (could be a couple of minutes), did you close the avd too early?

Mac HAX is not working and emulator runs in emulation mode

I have been running to the following error with Latest Android Studio.
emulator: The memory needed by this VM exceeds the driver limit. HAX
is not working and emulator runs in emulation mode
I am using Mac Pro with OS 10.1.xx
I have also executed required intel drivers and confirming the installation by running the following command in Terminal Console.
kextstat | grep intel
But I am still getting the same error.
Please help.
Amount of memory when you installed HAXM and amount of memory of your emulator device? If you set 1 gb ram when you installed HAXM and your device has 1536 for example, haxm cant works.
Try reducing the Ram of your Virtual Device to the one on HAXM and it should work!!! To do that go to Tool->andriod->Avd and then select your device and click on pen . go to Advance and locate the Ram option and reduce it from there

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.

Categories

Resources