16

I've decided to teach myself how to program android apps, and so got the ADT onto eclipse and going through the tutorials on the android development page. I've run into a problem where eclipse doesn't launch the emulator to run the app a second time.

I first noticed the problem on the second tutorial talking about different layouts for an app. I'm able to run the app just fine the first time, the emulator pops up and I see the layout that I'm testing. I then close the emulator, make a small change (or no change at all), run it again, and eclipse gets stuck in "launching delegate" part. In the bottom right hand corner it states that it's loaded to 27%, but then nothing happens. My CPU isn't being taken up by any processes that you'd expect with it launching an emulator. I've tried canceling the launch but then that just gets the new title of "canceling launch" and still nothing happens. If I close and reopen eclipse, I'm able to launch like normal again, but then the second try it does the same thing.

I then went back to the first tutorial ("Hello Android!") and found the problem exists there as well. I've tried killing and restarting the server in adb and that didn't help.

I'm emulating for android 2.2 froyo on windows xp in eclipse. I have java JDK 6u29 installed.

UPDATE:

Rerunning the app in the emulator without closing said emulator doesn't work - progress bar still loads and stops at 27% with no change afterwards.

UPDATE 2:

Problem not solved, but found a work around by just keeping the emulator running.

Vici37
  • 518
  • 1
  • 5
  • 9
  • 1
    This is not an answer to your question (haven't come across that same problem myself), but may help save some time anyway... you don't actually have to close the emulator to launch an updated version of your app, or to launch a different app. As long as it's the "appropriate" level etc., you can re-use the emulator and keep re-deploying apps and newer versions of apps to it. – Amos M. Carpenter Nov 28 '11 at 07:22
  • I thought I might be able to do that, but I couldn't figure out how. How can I reinstall an updated version of my app on the emulator? – Vici37 Nov 28 '11 at 07:25
  • Just right-click on your app project and do "Run As... -> Android App" (or whatever the menu item is named that you usually call, haven't got it here at the moment) while the emulator is already running. It takes a few seconds, but not nearly as long as when you have to re-start your emulator. You should see the output as it's deploying in your log view. – Amos M. Carpenter Nov 28 '11 at 07:36
  • Thanks, but it didn't work, just tried it. I have the emulator up, tried running the application again and the same progress bar starts up again with no change to the log view. – Vici37 Nov 28 '11 at 07:42
  • Sorry, that should have been LogCat view. If it's not updating, go to the DDMS perspective and make sure your emulator is selected in the "Devices" view, sometimes they become "disconnected"). If it still hangs, I'm afraid I'm out of ideas... hopefully someone else will be able to help. – Amos M. Carpenter Nov 28 '11 at 07:43
  • try check snapshot in avd – formuser66 Dec 20 '14 at 18:08

7 Answers7

14

I think I have found a solution.

right click on your project -> Run As -> Run Configurations -> Common -> uncheck "Launch in background"

At least, it works for me:)

shebik
  • 653
  • 9
  • 10
10

Team,

Found some solution for this, hope it helps

  1. Start the eclipse
  2. Go to Windows->AVD manager-> select the Virtual device -> click start
  3. Right click the project -> select run as-> run configuration and the same virtual device
  4. Your application should load now
  5. Dont close the emulator, you can make changes to the code and follow the 3rd step

Till now i don't have problem with this method, any thoughts would be highly appreciated

1

I too had a very similar problem. I have observed that this problem surfaced when I changed Android version that my app is supposed build against is changed (from 2.2 to 4.3 or vice-verse) after the emulator is up.

To recover I had to terminate eclipse (make sure eclipse and emulator are not running in task manager) and start all over again.

DJ7
  • 99
  • 1
  • 1
1

I ran into a related but different problem today. I created an emulator with snapshot enabled for the first time. I was no longer able to run apps for a second time from "Run As".

The workaround was to launch the AVD from the AVD manager instead of the first "Run As" invocation.

Paul Beusterien
  • 27,542
  • 6
  • 83
  • 139
1

I havent read all of the comments yet I had the same problem and solved it. The only thing that I did was to launch the AVD manager and click the AVD that you've already created before, then click start button. Once again, please do these steps before running your program as an android app. Hope it works ...

1

I don't know if you still have this problem. I was having the same problem. On the upper right hand side it had DDMS instead of Java. Once I switched it to Java it worked. I had to change it to Java EE first then Java. I have not idea why it works that way, but it works

Aaron
  • 4,380
  • 19
  • 85
  • 141
0

This might be grasping at straws as it's hard to say exactly what's causing your problem, but have you had a look at this question and its answer?

If not I hope the workaround with re-deploying once it's up and running is good enough :-)

Community
  • 1
  • 1
Amos M. Carpenter
  • 4,848
  • 4
  • 42
  • 72