28

I have followed the "Hello World" example from Google's Android developer's guide. When I try to run the application in the SDK emulator, nothing happens. The emulator startd up nicely, but after that nothing happens. I can't even see the application in the app tray.

I am using Eclipse with the Android add-on installed.

Christian Tang
  • 1,450
  • 4
  • 19
  • 30
  • What do you mean by nothing happens? – Anthony Forloney May 08 '10 at 11:59
  • 1
    Hi guys...I have just started android development from this evening and got stuck with the same problem as all of you discussing about,am running on windows 2003 server R2,please ray some lights on me on this issue... N.B, I'm using all latest versions Android SDK 2.3.1, Eclipse 3.6 Classic, Java 6.1 –  Jan 30 '11 at 23:27
  • Start eclipse using eclipse.exe -clean – Mohit Sep 30 '11 at 05:38

12 Answers12

31

Had the same problem, the console log stalled after:

Launching a new emulator with Virtual Device

and the emulator never showed the HelloAndroid application. I finally figured it out! In Eclipse go to

Run --> Run Configurations

Then change the Launch Action for your application (e.g. HelloAndroid) from "Launch Default Activity" to "Launch:" and then select your application from the pull-down menu. This did the trick for me.

HTH, Sven

Sven Boehringer
  • 311
  • 3
  • 2
  • 2
    This didn't exactly fix my problem but it was a step in the right direction. I was trying to get a sample application running and what I found was that it didn't have any Activities listed, so obviously there wasn't a default either. – spaaarky21 Nov 29 '12 at 18:09
  • this helped me. why is that? – cikatomo Mar 16 '13 at 15:22
  • This was exactly what my problem was. Thank you very much. –  Mar 29 '13 at 19:46
27

Same here; emulator loads fine but apk doesn't get installed. Problem is only with the emulator. All works fine if physically connecting a device with USB debugging turned on.

NB This suddenly started happening for no apparent reason. All used to work fine.

I've tried uninstalling and reinstalling the ADT Plugin and I've updated the Android SDK and AVD Manager to the latest available. (Tools revision 7) but the problem continues.

Eclipse: Helios Service Release 1 Build id: 20100917-0705 Running on Windows XP SP2

Just as others have posted, the console log shows

[2010-10-14 11:39:33 - uad-MediaPlayerExample] ------------------------------
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Android Launch!
[2010-10-14 11:39:33 - uad-MediaPlayerExample] adb is running normally.
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Performing com.msi.manning.chapter10.MediaPlayerExample.MediaPlayerActvity activity launch
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Automatic Target Mode: launching new emulator with compatible AVD '1.6-hvga'
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Launching a new emulator with Virtual Device '1.6-hvga'

LogCat remains empty/blank.

And if I then try to re-run the same app, the console shows:

[2010-10-14 11:39:33 - Emulator] emulator: ERROR: the user data image is used by another emulator. aborting

POSSIBLE ANSWER??? One solution seems to be to kill the adb.exe process in Windows Task Manager (while the emulator is still running). screenshot of task manager

(from http://vikashazrati.wordpress.com/2008/01/01/quicktip-android-does-not-load-my-application-in-the-emulator/)

The console suddenly shows lots of errors:

[2010-10-14 12:12:00 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:01 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:01 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:02 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:02 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:03 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:03 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:04 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:04 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:05 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:05 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:06 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:06 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host

but the app starts in the emulator. !!!

(as expected the LogCat also suddenly starts to display lots of messages)

All works fine - i.e. you can work on your code and re-run the app in the same emulator and it reinstalls as expected...

BUT if you close the emulator, you see the following console error:

[2010-10-14 12:15:05 - DeviceMonitor]Sending jdwp tracking request failed!

And the same problem reoccurs - a new emulator appears but the apk isn't installed. So you need to go back to Windows Task Manager and once again kill the adb.exe process.

NB I find that adb.exe doesn't reappear in the Task Manager unless I restart Eclipse, so after closing an emulator you have to restart Eclipse, try Run (which fails to display the app) then go back to the Task Manager where adb.exe is once again listed and kill the process for the app to start.

Would be great if someone could provide an explanation for this and a permanent fix...

baroquedub
  • 952
  • 1
  • 10
  • 13
  • 1
    Thanks! Another way to kill the adb is by calling adb kill-server and then adb start-server from the command line in the folder of the sdk that contains the adb. In my case C:\Program Files (x86)\Android\android-sdk\platform-tools – kingston Feb 17 '12 at 23:00
  • @herschel: the commands are definitely better than restarting the eclipse .. thanks – McLan May 23 '13 at 23:51
10

I have the similar problem. I suggest the following workaround:

  1. close eclipse, in the Task Manager, kill all adb and emulator* processes.
  2. start eclipse, run your application, wait untill the emulator starts. If you have the problem, your application won't be started, there will be the bare emulator.
  3. In eclipse, select Window->Open Perspective->Other->DDMS. Switch to DDMS perspective. If you have the problem, the list of the devices will be empty.
  4. In the Devices tab, in the drop-down box, select "reset adb". In a short while, the emulator must appear in the devices list.
  5. Following that, switch back to your Java perspective and run your app. Everything must work fine for the rest of the session.
LPL
  • 16,827
  • 6
  • 51
  • 95
the mighty fd
  • 101
  • 1
  • 2
2

Actually, if you are using Windows, the problem might be that the User Account Control in your Windows is preventing Eclipse to load the apk in the emulator (Eclipse doesn't have right to do so).

To turn off the User Account Control, go to the Control Panel, click User Accounts and Family Safety, and then click User Accounts. Once there, click the option 'Turn User Account Control on or off'.

Oscar
  • 21
  • 1
1

In my case the problem occurs because of the simple thing: i do not select the project that i want to run. Click on it in solution folder, then press run and enjoy. Hope it will help someone.

Sorokin Andrey
  • 419
  • 5
  • 12
1

Depending on your computer it can takes several minutes to load the emulator and the app. Open Logcat view to see the progress of loading.

1

Same problem. Killing adb from task manager didn't help. Also tried restarting the AVD using android create avd --target 2 --name my_avd --force, no good. Tried the different launch method in Eclipse, nada.

What eventually helped is: I started (from the start menu, not command line) the Android SDK Tools > SDK Manager, found the my_avd under virtual devices, and simply clicked the Start... button. That did it - the emulator started, I ran from Eclipse, and it immediately showed the app on the emulator.

jack
  • 11
  • 1
1

One solution is go to android sdk/tools directory and start ddms.bat for Dalvik Debug Monitor, then select Actions->Reset adb. That seem to fix the problem

milous
  • 213
  • 2
  • 5
  • 14
0

STEPS TO FOLLOW:

  1. Go to Command Prompt
  2. type adb kill-server
  3. enter

Now it should work fine

Andy
  • 49,085
  • 60
  • 166
  • 233
SRK
  • 118
  • 2
  • 10
0

The Android emulator takes approximately 1 to 2 mins to load. Check the console tab in the eclipse IDE for evaluating the progress of loading the emulator and installing the application in the emulator.

Primal Pappachan
  • 25,857
  • 22
  • 67
  • 84
  • [2010-05-08 14:47:35 - de.vogella.android.first] Android Launch! [2010-05-08 14:47:35 - de.vogella.android.first] adb is running normally. [2010-05-08 14:47:35 - de.vogella.android.first] Performing de.vogella.android.first.Hello activity launch [2010-05-08 14:47:35 - de.vogella.android.first] Automatic Target Mode: Preferred AVD 'TestDevice' is not available. Launching new emulator. [2010-05-08 14:47:35 - de.vogella.android.first] Launching a new emulator with Virtual Device 'TestDevice' [2010-05-08 14:57:45 - Emulator] emulator: warning: opening audio input failed – Christian Tang May 08 '10 at 12:59
  • The emulator would load inspite of warnings. Can you post the logcat output in the question? This will give a better idea of what's going on. To display logcat: Window -> Show View -> Other -> Android -> Logcat – Primal Pappachan May 08 '10 at 14:36
0

I used to face this problem a lot. There is workaround for this,

End the "adb.exe" process from the Task Manager and try again.

It should work. and instead of running from eclipse i use following batch files in my project directory to install and uninstall the apk. Those work great.

Install.bat

cd bin
adb install *.apk

Uninstall.bat

adb uninstall this.is.package.name
Vijay C
  • 4,739
  • 4
  • 41
  • 46
  • Actually after ending process adb.exe you have to install the application from the command line using the above mentioned commands. – Vijay C Sep 19 '10 at 18:14
0

For me the solution was to choose "app" instead of "RSSReader" (my project name) in the dropdown next to the AVD tray. When I choose "RSSReader", the AVD is greyed out and unusable.

This leads me to wonder if my project is setup wrong or if "app" is the correct state.

enter image description here

nettie
  • 628
  • 1
  • 11
  • 23