Not able to run the Android Emulator - android

Build was successful but when I tried to run the project using AVD, it shows the following message. I'm not sure what went wrong.
Warning: No DNS servers found
emulator: device fd:608
HAXM is not working and emulator runs in emulation mode
emulator: The memory needed by this AVD exceeds the max specified in
your HAXM configuration.
emulator: AVD RAM size = 1536 MB
emulator: HAXM max RAM size = 512 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM
configuration to run in fast virt mode.
creating window 43 59 329 583 emulator: UpdateChecker: skipped version
check

You need to adjust your adb ram size.
First open android studio.Then at the top icon bar you can find this icon.Click it.This will open all available virtual device you have.Select your virtual device and at the right you can find this icon .Click it.This will open a new window.At the bottom of this window you can find this .Click it.Then there will be a section like this .Then change RAM size 1536 to 512.Like this .Now click finish and run your application.
Edit:
If your target api is upper than 19 then you need to adjust your haxm installer ram size because when you run your app the avd ram size will increase to 1 GB.
So how to adjust your haxm installer ram size.Follow the step mentioned below.
If you install android studio by it's default position then you can find haxm installer in this locaiton
'C:\Users\Niyamat\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager'
Go to this location(make sure you change userName Niyamat to your username).Click "intelhaxm-android" and run it.Then an alert dialog pop up like this click yes.Then click Next.And finally click Set manually.and remove 512 and add 1024.Something like this .Then click next then install.Wait few seconds for install.And that's it.I think now you can run your app on your virtual device.
Hope this help!

HAXM RAM size should be more than AVD.
Better decrease the RAM size of AVD by editing the emulated device or the other way increase HAXM RAM size.

HAXM RAM size should be more than AVD. Decrease the RAM size of AVD or increase HAXM RAM size.
To reduce ram of avd (Wich I recommend)
Go to your avd manager. Delete the emulator and create a new one. However for the new one make sure it's ram is less than 512 mb.

Related

Android Studio Running app is too late

i have a problem when i am trying to run my app with a emulator that its 2 hours and it didn't started until now
and this message was printed
emulator: device fd:892
HAXM is not working and emulator runs in emulation mode
emulator: The memory needed by this AVD exceeds the max specified in your HAXM configuration.
emulator: AVD RAM size = 1536 MB
emulator: HAXM max RAM size = 512 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM configuration to run in fast virt mode.
creating window 43 59 329 583
emulator: emulator window was out of view and was recentered
emulator: UpdateCheck: current version '24.4.0', last version '24.4.0'
I guess you said '2 hours' with exaggeration.
First 1536 MB Ram for an emulator is too much. You can reduce it to 512 or lower. Also I suggest you to use GenyMotion which is more faster and useful than standard android emulator (at least it my i3 device).
Using GenyMotion, I'm creating 320x480, Jell Bean emulator with 512 MB RAM in 1-2 minutes.
When you create an emulator using the AVD choose advanced settings and change the RAM to 1536MB. or just edit you current device the same way.

haxm is FINE, but still cannot launch AVD

I got this annoying issue. Every other posts are discussing haxm, but in my case, it works fine. I also tried to reduce RAM of AVD(1024M, 512M, 256M). Just cannot got AVDs work.
I got these messages when I attempt to launch an AVD.
emulator: WARNING: Increasing RAM size to 1GB
emulator: device fd:604
HAXM is working and emulator runs in fast virt mode
Cannot set up guest memory 'pc.ram': Invalid argument
It seams if I chose higher API version (like 21+), RAM assigned to AVD will automatically increased to 1GB, then comes "Cannot set up guest memory 'pc.ram': Invalid argument".
My solution is to choose lower version system images and set AVD RAM as 512 MB.

HAXM configuration in android studio

I tried to run a simple Android chat app from GitHub. I think there's a problem with my HAXM configuration. When I run the app I see these errors:
HAXM is not working and emulator runs in emulation mode
emulator The memory needed by this AVD exceeds the max specified in your HAXM configuration.
emulator: AVD RAM size = 1536 MB
emulator: HAXM max RAM size = 768 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM configuration to run in fast virt mode.
emulator: warning: opening audio output failed creating window 61 83 462 820
emulator: emulator window was out of view and was recentered
What is wrong?
Reinstall HAXM with more RAM:
sudo $ANDROID_SDK/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh -u
sudo $ANDROID_SDK/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh -m 1024
your HAXM RAM is lower than your AVD RAM.
Solutions:
Re-run you HAXM installation and increase RAM to match that of AVD(emulator).
Alternatively, decrease RAM of AVD(emulator) to match that of HAXM.
The memory needed by this AVD should not be exceeds the max specified in your HAXM configuration.
It should be less than RAM set for HAMX.
Go to ~\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager \intelhamx_android.exe.
Reinstall intel HAXM and set its RAM to 1024MB.
Edit your AVD set its RAM to 768MB.
Build and run your application.
If you cant change the RAM via reinstalling it means you installed HAXM via Android Studios.
Ctrl + Alt + S
click on SDK Tools
uncheck the box for Intel HAXM (Intel HAXM Installer)
click Apply
recheck the box for Intel HAXM and the program should now ask you to reenter the RAM Usage via slider or number
Be sure when you increase your HAXM RAM configuration that your computer is able to handle this increased RAM. I use a 4GB RAM macbook pro that almost stopped responding after I increased HAXM RAM to 2GB. It may be a better option to decrease your AVD RAM.
After re-installing HAXM with more (ideally more than 1536 MB) space solves the problem.
How to install HAXM for MAC -
https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-mac-os-x
How to install HAXM for Windows -
https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-windows
Just go to:-
Help >> Edit Custom VM options >> (see the picture below) >> Then close the file >> Restart android studio
You have to increase the amount of RAM memory in:
Tools >> Android >> AVD manager
Select your AVD, press "Edit this AVD" and under Advanced settings set the amount of RAM to i.e. 1500Mb
That will do the trick

emulator-x86.exe has stopped working after lauching

I am using Android Studio in Windows 8.1 with 4 GB RAM; given 2 GB to virtual memory. But when ever I run the emulator I get the following:
C:\Users\CSE\AppData\Local\Android\sdk\tools\emulator.exe -avd Android_API_21 -netspeed full -netdelay none
emulator: device fd:828
HAX is working and emulator runs in fast virt mode
emulator: warning: opening audio input failed
creating window 0 0 384 729
emulator: emulator window was out of view and was recentered
The emulator starts and suddenly stops showing massage:
emulator-x86.exe has stopped working
I have edited the current device & also created new AVD with resolution 800x600 and RAM 512 MB ( & less ) but nothing works. HMAX is installed.
Suggestions will be really helpful. Thanks in advance.
Here is how I solved in a laptop with Windows 10 + HAXM enabled, to run the default "Nexus 5 API 23 x86" Device.
My laptop has 2 video cards, the integrated Intel HD 3000 and a GeForce 525M.
On NVIDIA Control Panel, switch "Preferred graphics processor" to Auto-select or Integrated graphics.
The emulator doesn't work here when I set the NVIDIA GPU as preferred.
Check this path
C:\Users\Username.android\avd. Edit the file emulator-user & set the window.x = 0, window.y = 0
Create the hdpi virtual device like Nexus S 4.0 480x800 hdpi.
In AVD Manager, Select your device which is stopped. And click the edit in the right side of the wizard. It shows the options and features of your current device like ROM size, Internal and External Storage etc.
Uncheck the Use Host GPU.
In that wizard select Show Advanced Settings -> Memory and Storage -> RAM: 764MB
VM heap: 32MB
Internal Storage: 200MB
Change these settings and restart your Android Studio

Android: failed to allocate memory

I'm trying to create an emulator with 2047 mb ram.
When I run it, I get this error:
[2011-02-22 14:24:14 - Emulator]
[2011-02-22 14:24:14 - Emulator] This application has requested the Runtime to terminate it in an unusual way.
[2011-02-22 14:24:14 - Emulator] Please contact the application's support team for more information.
[2011-02-22 14:24:26 - Emulator] Failed to allocate memory: 8
I understand that lowering the number will make it work. But I'd rather have it with more ram, so I can test a game I'm developing. I'm assuming with more ram, it would run faster...
Has anyone got 2047 mb of ram on the emulator? If so, how? What settings did you use? Did you change anything special on your computer?
Using windows 7 64-bit, updated to the latest android sdk. Also I have over 8gb of ram available. I do have one device (motorola milestone) to test on, however since it is a network-based game I need at least one other client (hoping to use the emulator) to run with in addition to my phone.
Solution to running a faster emulator:
http://androiddevnotes.com/2011/03/08/1299521520000.html
Runs my game a lot faster, comparable to phone quality.
-- Update 08/24/12 --
I see that people still come here and comment on this answer, and I have done more research on this issue. I present to you the results of my findings.
NOTE: These tests were run on my computer, your computer may be different.
Running an Android 2.2 (armeabi) emulator with Property 'Device ram size' = 2048 will
fail, just as before
Running an Android 2.2 (armeabi) emulator with Property 'Device ram size' = 2048 MB will pass, however if you actually check the ram on the device, its around 128 MB.
check 1: Settings > Applications > Running Services - add all the numbers on the bottom of the screen
check 2: run the following command in adb shell: cat /proc/meminfo/ and note the MemTotal field
Running an Android 4.1 (armeabi-v7) emulator with Property 'Device ram size' = 2048 will work, however if you actually check the ram on the device its around 512 MB
check 1: Settings > Apps > Running tab - add all the numbers on the bottom of the screen
check 2: run the following command in adb shell: cat /proc/meminfo/ and note the MemTotal field
Running an Android 4.1 (armeabi-v7) emulator with Property 'Device ram size' = 2048 MB will work as well, but with the same results as 3.
Conclusion
Adding 'MB' as noted in some of the comments below may allow your device to be launched, however it doesn't actually have 2 GB of RAM. Even with a 4.1 Emulator, the RAM Size is at 512 MB.
Recommendation
Please use an actual device for testing.
I also get this error. Use RAM 512.
I was also getting this error message after upgrading my Android ADK Tool to 20 (even though I have more than sufficient RAM). No changes made to the 'Device RAM size' property helped (whether higher or lower, or with "MB").
What did work for me is running the emulator at the command line and specifying the RAM amount there (less than the default in my case); for example:
emulator -memory 512 -avd my_avd
Add in Run Configurations window the parameter
-memory 512
See screenshot for reference
Solution is that you go and edit the config file for that perticuler avd in .android folder in your user folder in c drive
with RAM = 1024 MB instead 1024
The problem is MB is not there...
I had the same problem but then figured it out. The problem was in the amount of ram I had specified for the virtual machine, and it was 1024MB by default, now I changed it to 512MB and it works; though my pc has 8GB of RAM.
I had the same issue but before I got the issue it asked me to capture a video source. I disabled the camera support and I was able to use 1024MB of RAM. Using Windows 64bit, Xoom (Android 3.0). i hope this helps for anyone with the same problem.
Edit the Device settings and change the RAM allocation to a lower number. If it was 1024 or More, reduce it to 512Mb or 256Mb.
You can Change it in "Edit Android Virtual Device (AVD)" dialog's Hardware Section --> Device ram size
I changed my monitor's DPI settings from the launch options of AVD and syncronized it with the original and current setting of my monitor, and it works for me.
I was getting "failed to allocate memory: 8" errors as well. I have W7-64bit and 8GB of RAM. I found that by running AVD "as Administrator" the error disappeared, allowing the emulator to launch.
Simple computer reboot helped me after I installed HAXM and got that error :)
I had to do this Go to "Tools -> Android -> AVD Manager -> Chose your device -> Edit -> Advanced Settings -> Change the RAM parameter to 512 Mb.

Categories

Resources