views:

1522

answers:

8

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.

A: 

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.

primalpop
[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
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
primalpop
A: 

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.

Roflcoptr
I'm using a AMD Phenom II quadcore CPU, and 4 GB RAM, so computerpower shouldn't be a problem. Where do I find the logcat view?
Christian Tang
A: 

how adt knows that emulator is now fully loaded and i can transfer application now for installation

jadav
A: 

I have a similar problem. I'm using Eclipse and when I try to run my HelloAndroid application, the emulator starts and loads and gets to the home screen. But then nothing happens.

The console log looks like this:

00:10:32 - HelloAndroid] ------------------------------
00:10:32 - HelloAndroid] Android Launch!
00:10:32 - HelloAndroid] adb is running normally.
00:10:32 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
00:10:32 - HelloAndroid] Automatic Target Mode: Preferred AVD 'my_avd' is not available. Launching new emulator.
00:10:32 - HelloAndroid] Launching a new emulator with Virtual Device 'my_avd'

Earlier (yesterday) I got it working, it installed the application and run it but now it stalls to that point. I have no idea why it does this. LogCat is completely empty.

I'm running this at Windows Vista with API level 8 in the virtual device.

blob
A: 

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
Nope. That didn't work for me......
Christian Tang
Actually after ending process adb.exe you have to install the application from the command line using the above mentioned commands.
Vijay C
A: 

I'm getting exactly the same as blob. Anyone has a solution to this? I'm using the latest ADT on Eclipse Helios, Win 7 x64.

Example from Console (LogCat is empty as the apk doesn't get built/installed).

[2010-09-22 22:22:16 - Test] ------------------------------
[2010-09-22 22:22:16 - Test] Android Launch!
[2010-09-22 22:22:16 - Test] adb is running normally.
[2010-09-22 22:22:16 - Test] Performing com.myTest.Test.Main activity launch
[2010-09-22 22:22:16 - Test] Automatic Target Mode: launching new emulator with compatible AVD 'test'
[2010-09-22 22:22:16 - Test] Launching a new emulator with Virtual Device 'test'

The AVD starts fine but no apk is installed. I only have this problem on one of three computers and I can't for my life see any difference in the setup on any of them.

Any help would be nice!

A: 

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
Thanks! This worked perfectly.... It would be nice if they made a fix for this.
Christian Tang
A: 

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