emre celenk
emre celenk

Reputation: 69

emulator-5554 disconnected! Cancelling 'com.example.merhaba.Main activity launch'!

I started to write android app with eclipse IDE. But when I run the app I am taking emulator-5554 disconnected! Cancelling 'com.example.merhaba.Main activity launch'! error. What can I do?

Upvotes: 6

Views: 20669

Answers (6)

minkwoski matete
minkwoski matete

Reputation: 31

You can kill ADB from the Window Task manager but I advice you kill the ADB process tree. By right clicking on the adb on the Task manager and then click on END Process TREE. That worked for me and I believe it will help you to solve the problem. But make sure you have your AVD recognised. To do this click window--AVD Manager--click on the AVD you want to use to highlight it, then click on the START tab--The launch options opens up. Click on Wipe user data and then click on LAUNCH. That will help you launch your identified AVD before you go ahead to kill Adb process tree as I described earlier. That did the magic for me. After doing this try running the program. If you get an error like "Activity not working", don't panic. It's not an error but it's just there to tell you that you are running your program again without any change or update on the code. You can just click the backward button on your emulator and then run again and you won't see that error again.

Upvotes: 3

sara piprani
sara piprani

Reputation: 21

Go to run-> configuration->Target->select Avd -> Run it. It solved my problem which made me crazy

Upvotes: 2

Vero
Vero

Reputation: 1750

This solved it for me:

1) Leave Eclipse open and the emulator also open even though Eclipse doesn't find it.

2) In command line type:

adb kill-server

Then when prompt comes back, type

adb start-server

3) After adb starts again, try to run your project again from Eclipse.

Upvotes: 4

Sathish
Sathish

Reputation: 4713

The problem as I discovered lays in the fact the the project has no appropriate Virtual Device defined for it in the AVD manager.

So the recommended steps in eclipse are:

  1. Go to "Project"-> Properties-> Android.
  2. On the right pane see what line is checked in the Project build target.
    Remember the target platform number that appears in the selected line.
  3. Go to "Windows"-> AVD Manager.
  4. Check the list of existing Android Virtual Devices for a device that matches the Platform and API level that you have set for your project (see step #2 above).
  5. If there is no line that includes an AVD for your platform (as I suspect), add it using the "New" button.
  6. A "Create New Android Virtual Device" window will be opened. set a new device name. in the "Target" selection box choose the right platform for your project.

--- OR ---

  1. Open Android Virtual Device Manager
  2. select the AVD you use for your app.
  3. Press the start button and wait for a new form to show up called (Launch Options).
  4. Check the box "Wipe user data" and hit "Launch" button.

This should work.

--- OR ---

  1. Open Android Virtual Device Manager
  2. Delete the AVD you use for your app.
  3. Create an new AVD.
  4. Start you new AVD.

This should also work.

-- OR --

try this.. go to DDMS perspective-->select Device-->go to Window-->Navigation-->Show view menu-->reset adb.. .

Enjoy your emulator once again!

Upvotes: 9

AlexBcn
AlexBcn

Reputation: 2460

Go to the Device view and on the upper right corner there is a down arrow, click there an later on reset adb..after a few seconds try to re-run the app,it should work.

Upvotes: 1

Aashish Bhatnagar
Aashish Bhatnagar

Reputation: 2605

just restart your eclipse and run it again

Upvotes: 1

Related Questions