Vici37
Vici37

Reputation: 518

Eclipse not running Android app on emulator a second time

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.

Upvotes: 16

Views: 16589

Answers (7)

DJ7
DJ7

Reputation: 99

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.

Upvotes: 1

Aaron
Aaron

Reputation: 4480

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

Upvotes: 1

Davut CANLI
Davut CANLI

Reputation: 21

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 ...

Upvotes: 1

shebik
shebik

Reputation: 653

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:)

Upvotes: 14

Paul Beusterien
Paul Beusterien

Reputation: 29582

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.

Upvotes: 1

Narendran Srinivasan
Narendran Srinivasan

Reputation: 124

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

Upvotes: 10

Amos M. Carpenter
Amos M. Carpenter

Reputation: 4958

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 :-)

Upvotes: 0

Related Questions