Android AVD disconnected - android

My AVD was working before and now suddenly it doesn't load, gives me black screen and gives me this error:
[2014-10-21 13:36:55 - l] adb is running normally.
[2014-10-21 13:36:55 - l] Performing com.k.l.MainActivity activity launch
[2014-10-21 13:36:56 - l] Automatic Target Mode: launching new emulator with compatible AVD 'AVD_for_3_4_WQVGA'
[2014-10-21 13:36:56 - l] Launching a new emulator with Virtual Device 'AVD_for_3_4_WQVGA'
[2014-10-21 13:43:03 - l] New emulator found: emulator-5554
[2014-10-21 13:43:03 - l] Waiting for HOME ('android.process.acore') to be launched...
[2014-10-21 13:43:05 - l] emulator-5554 disconnected! Cancelling 'com.k.l.MainActivity activity launch'!
I removed it and created a new one. Selected option 'Wipe User Data'. My Target is Android 3.2 and ADV Target also says Android 3.2. I restarted Eclipse, still the same error. It also gave me error that another instance of avd might be running, but I have nothing else running. What am I doing wrong? Thanks!

Whenever you face that emulator is disconnected problem, do the following.
1) Restart the adb , eigther from command prompt or if you are using windows: go to task manager and select --> Processes tab and select adb.exe and click on end process. It will restart the adb and the connection between the eclipse and Emulator will be established.
Note: There are so many way to restart the adb, but above mentioned is one way in windows.
2) You can also increase the disconnection time for the emulator.
In Eclipse--> Go to WINDOW-->Prefrences-->android-->DDMS>increase the timeout value. Increseit to 10000 or more.
Note: You dont have to recreate a new AVD or restart the AVD if you do the above things.

Related

Failed to install apk on device 'emulator-5554': No such file or directory

Yes there are several other questions on SO like this, I've tried what is suggested there, to no avail. Note that I am trying to run an emulator here, not an actual device.
I have set the Run Configuration to Always prompt to pick device. Then I do Run as > Android Application, then selected emulator, then waited for it (until AVD Name appears)
[HelloWorld] New emulator found: emulator-5554
[HelloWorld] Waiting for HOME ('android.process.acore') to be launched...
[HelloWorld] ------------------------------
[HelloWorld] Android Launch!
[HelloWorld] adb is running normally.
[HelloWorld] Performing com.mkyong.android.HelloWorldActivity activity
launch
[HelloWorld] Uploading HelloWorld.apk onto device 'emulator-5554'
Then did Run as > Android Application and selected the running emulator-5554, which gives the error:
[HelloWorld] Failed to install HelloWorld.apk on device 'emulator-5554': No such file or directory
[HelloWorld] com.android.ddmlib.SyncException: No such file or directory
[HelloWorld] Launch canceled!
I have tried the following repeating the above steps afterward:
Deleted bin and gen folders, then did Clean
I went into DDMS and did Reset adb. then did Run as > Android Application and selected the running emulator-5554 with the same result.
Changed the ADB connection timeout from 5000ms to 10000ms
Window -> Preferences -> Android -> DDMS -> ADB Connection Timeout (ms)
Opened task manager, end the task named "adb" then restarted eclipse. Then Project Clean.
Closed the project, Closed Eclipse, then Restarted Eclipse and opened project
Started emulator independent of the project via Android Virtual Device Manager > Start > Launch
This results in the emulator window being displayed, but contains nothing (completely black)
and another window saying:
Starting emulator for AVD ''
emulator: warning: opening audio input failed
And it remains this way. Even clicking Cancel does nothing.
I went inot the Android Virtual Device Manager > Android Virtual Devices, then
Select a device, Edit. In the Device pull down, select a device if one is not selected Memory Options: RAM 768. Then Start > Launch, The Emulator window comes up. "Android" is displayed in the window.LogCat shows lots of stuff, this seems significant:
Failed to connect to host (QemuPipeStream)!!!
E/EGL_emulation(420): Failed to establish connection with the host
Any suggestions?
Maybe check you have the relevant SDKs installed for the API of the emulator?
Windows -> Android SDK manager
Shot in the dark from me.

android emulator in ADT plugin not running

I'm using Eclipse ADT plugin for android development. I came across some problems and I remove all my existing emulators and create a new one. when I run an android project and start the emulator, it just pop up and freezes with a black screen even before it start Android os.
and the progress tab shows,No operations to display at this time. and the logcat displaying I/ServiceManager(270): Waiting for service SurfaceFlinger... over and over again. And the console shows
[2013-12-02 14:54:03 - Emulator] emulator: warning: opening audio input failed
[2013-12-02 14:54:03 - Emulator]
[2013-12-02 14:54:04 - AndroidV4Virtusel] New emulator found: emulator-5554
[2013-12-02 14:54:04 - AndroidV4Virtusel] Waiting for HOME ('android.process.acore') to be launched...
But the emulator never launched. No rusalt although I restart the IDE.
when I restart the adb using DDMS perspective it gives following error.
[2013-12-02 15:22:50 - DeviceMonitor] Adb connection Error:An existing connection was forcibly closed by the remote host
[2013-12-02 15:22:51 - DeviceMonitor] Connection attempts: 1
The avd manager also shows the emulator as a valid emulator
And when I close the emulator the console shows,
[2013-12-02 15:34:23 - hierarchyviewer]Unable to get view server version from device emulator-5554
[2013-12-02 15:34:23 - hierarchyviewer]Unable to get view server protocol version from device emulator-5554
[2013-12-02 15:34:23 - ViewServerDevice]Unable to debug device: My1 [emulator-5554]
[2013-12-02 15:34:23 - hierarchyviewer]Missing forwarded port for emulator-5554
[2013-12-02 15:34:23 - hierarchyviewer]Unable to get the focused window from device emulator-5554
So can someone help me? Thank you!!!
To solve this, go to Window --> Open Perspective --> DDMS.
In the DDMS View, look for devices on the left of your screen. You should see a bar having about 12 icons. Click on the down arrow and click the "reset ADB". It should work afterwards.
In this case, I was able to run an emulator with Android 2.2. But unable to run an emulator in Android 4.2 which is my applications target. So i just removed Android 4.2 (API 17) and just reinstall it. Later on emulator starts fine. Thanks!!
I would suggest you to use the blue stacks as your emulator.. its really faster and efficient.. If you are using the Blue Stacks, first start your blue stacks and then eclipse or whatever the IDE you are using...
you can also have a look here
http://infopulseukraine.com/eng/blog/Software-Development/Mobile/Bluestacks_Eclipse/
As an extension to Jimi's answer, the easiest way to restart adb is to type the following command into a console window:
adb kill-server
If you get an error about adb command not found, then you can either add the android system tools path to your PATH key in environment variables, or just navigate to the tools directory and execute the command from there:
./AndroidSdk/platform-tools
After killing the server, make sure it's restarted correctly by typing:
adb devices
Which should show you a list of connected devices.
After restarting adb, the device manager should automatically refresh, otherwise try restarting device manager or selecting the refresh window button.
Maybe there is something wrong with your AVD properties,change it to where it compatible to your android projects,that's all.

Android emulator doesn't launch despite console shows that apk is installed successfully and activity is starting

This question has been asked here multiple times but nothing works for me. I have installed Android SDK on Windows 7 and trying to run HelloWorld project on the emulator. Unfortunately it never launches and just always showing flashing ANDROID label. The console says:
Waiting for HOME ('android.process.acore') to be launched...
As suggested here i run my project as Android application once again and yes, things change, now the console happily tells me:
[2013-07-27 22:53:36 - HelloWorld] Uploading HelloWorld.apk onto device 'emulator-5554'
[2013-07-27 22:53:37 - HelloWorld] Installing HelloWorld.apk...
[2013-07-27 22:53:55 - HelloWorld] Success!
[2013-07-27 22:53:56 - HelloWorld] Starting activity com.example.helloworld.MainActivity on device emulator-5554
but the emulator remains unchanged, just flashing with ANDROID. Can anyone give an advice?
Increase ram for the virtual device and try to select a old device with small screen to emulate , btw some times the splash screen may take up to a minute to load depending in your computer
Consiter using this very fast alternative:
genymotion
You can launch from eclipse and android studio, it has great performance.

AVD showing only "Android" in emulator

Android Launch!
[2013-06-17 15:38:53 - Numberconverter] adb is running normally.
[2013-06-17 15:38:53 - Numberconverter] Performing com.example.channu.Numbersystem activity launch
[2013-06-17 15:39:00 - Numberconverter] Launching a new emulator with Virtual Device 'AMMA'
[2013-06-17 15:39:05 - Numberconverter] New emulator found: emulator-5554
[2013-06-17 15:39:05 - Numberconverter] Waiting for HOME ('android.process.acore') to be launched...
Nothing is wrong.
Waiting for HOME ('android.process.acore') to be launched...
Means that it is actually waiting for the OS to be loaded on the emulator. This usually takes a few minutes depending upon the configuration of the system you are using.
Just wait for a few minutes and you would be able to see the usual Android OS loaded on the emulator.
The usual console output when you launch an app on a new emulator is something like:
[2013-06-17 16:06:52 - FirstRun] New emulator found: emulator-5554
[2013-06-17 16:06:52 - FirstRun] Waiting for HOME ('android.process.acore') to be launched...
[2013-06-17 16:08:00 - FirstRun] HOME is up on device 'emulator-5554'
[2013-06-17 16:08:00 - FirstRun] Uploading FirstRun.apk onto device 'emulator-5554'
[2013-06-17 16:08:01 - FirstRun] Installing FirstRun.apk...
[2013-06-17 16:08:30 - FirstRun] Success!
[2013-06-17 16:08:30 - FirstRun] Starting activity dev.swm.firstrun.MainActivity on device emulator-5554
[2013-06-17 16:08:32 - FirstRun] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=dev.swm.firstrun/.MainActivity }
you can, wait for few seconds and then right click on the project and click run as Android application once again.
also, The only thing that works for me is the combination of three other good answers:
1- Project -> Clean
2- Delete all the AVDs and create new ones
3- If an attempt to run still hangs too long on 'Waiting for HOME' (over two minutes) or the emulator keeps rebooting every minute or so, try Run as Android App several times, choosing the same existing emulator instance (I always choose runs manually).
It's odd that no one has a clue why this problem comes up, what causes it or what is going on internally. The only clue I can supply is that DDMS shows a few lines like "Class not found for preloading: libcore.base.CollectionUtils" during the 'Waiting for HOME' pause.
if not try doing that and see if you can start & see if everything
works.
1) try using Emulator command
2) in Eclipse, Window->Adnroid SDK & AVD manager ->Virtual Devices,
then select the AVD, press Start button
After you see the starting as shown above by swayam's answer in Eclipse "Console", "charging" screen appears, but then I pressed the "Menu" button on the right side and my program displayed and functions correctly. Just a newbie trying to help.
It's a memory Problem. Increase the ammount of RAM, I had the same problem and increasing the RAM worked.
Best of luck
I set higher ram 756MB and then clicked on use host GPU and it did work after that. Win8 and used Nexus5 emulator API 19.
Create new Avd of the same Api you using and try it will work
I used to have the same problem and managed to solve it by disabling Hyper-V (provided that you are running a Windows machine).
To do that, go to Control Panel -> Add/Remove Programs -> Turn Windows Features on or off -> Uncheck Hyper-V
There is one thing though: the Hyper-V feature is not available in Home versions of Windows. Also disabling it prevents you from using Windows Phone emulators, so keep that in mind.
Had the same problem. Even the side buttons were not appearing. I increased the ram from 512 to 750mb, and it worked like a charm.

Why is the emulator in eclipse restarting?

I am following http://developer.android.com/training/basics/firstapp/running-app.html
and trying to run my first android app on the emulator on my PC.
The emulator is running (started from eclipse)
I managed to lauch myFirst App via eclipse as described, although in this tutorial it should be added you have to wait minutes before the emulator is up and running.
Now my problem is that when I modify myFirstApp, and wnat to test it, that eclipse keeps starting a new emulator:
[2012-10-15 19:32:44 - MyFirstApp] ------------------------------
[2012-10-15 19:32:44 - MyFirstApp] Android Launch!
[2012-10-15 19:32:44 - MyFirstApp] adb is running normally.
[2012-10-15 19:32:45 - MyFirstApp] Performing com.example.myfirstapp.MainActivity activity launch
[2012-10-15 19:32:45 - MyFirstApp] Automatic Target Mode: Preferred AVD 'Hobbit' is not available. Launching new emulator.
[2012-10-15 19:32:45 - MyFirstApp] Launching a new emulator with Virtual Device 'Hobbit'
This is extremely annoying, because of the performance penalty to launch a complete emulator.
But what is even more frustrating that I get back the very first version of MyFirstApp in this new emulator.
When I restart myself the emulator from scratch I see this in the console:
[2012-10-15 19:55:42 - MyFirstApp] New emulator found: emulator-5554
[2012-10-15 19:55:42 - MyFirstApp] Waiting for HOME ('android.process.acore') to be launched...
[2012-10-15 19:56:57 - MyFirstApp] emulator-5554 disconnected! Cancelling 'com.example.myfirstapp.MainActivity activity launch!'
Why? The emulator is still running at this point. This cannot be the normal way of working. Can anybody help me out?
Go to Run -> Run Configuration in eclipse. Select your application and update the target tab at right side to "Always prompt to pick device"
If the emulator is running and doesnt show in Devices then try to reset adb.
In eclipse: Device tab-> Dropbown - > reset abd

Categories

Resources