Sunday, January 16, 2011

Failed to install HelloAndroid.apk on device - Android error

Today I started learning Android programming.To start with I downloaded the android sdk from the android developer site and followed the instruction there to install (http://developer.android.com/sdk/index.html).Once done I followed the next instruction to run the first program, yes the "Hello World" program.For this I followed the steps provided at "http://developer.android.com/resources/tutorials/hello-world.html".

But while running I faced with below error message:-

HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554!
HelloAndroid] (null)
HelloAndroid] Launch canceled!

I searched for the error message but didn't found any satisfactory solution.I tried several options.Then after some time I found the solution (a simple one).The solution to the above problem is:-
Set the path environment variable with the path of "platform-tools" and "tools" found in the
"sdk-home".

That's it.Now restart eclipse and execute the program.

24 comments:

  1. How to set the path????

    ReplyDelete
  2. Follow the below steps to set the path on windows(vista):-
    1.Go to "Control Panel\System".
    2.Select "Advanced System Settings".
    3.Select the "Environment variable".
    4.Set the path environment variable under the system variable with values "SDKHOME\platform-tools;SDKHOME\tools". Where "SDKHOME" is the home folder of Android sdk.

    ReplyDelete
  3. That worked perfectly. Thank you!

    ReplyDelete
  4. Still working, for me too, thanx a bunch!

    ReplyDelete
  5. You are the man!!

    ReplyDelete
  6. Thank Anand Pandia! I really appreciate your work. It helped me alot. Keep continue to post such like tutorials. Cheers!!!

    ReplyDelete
  7. That's true, we need to change the path as said above, the most exactly you may add like this: C:\Documents and Settings\xp\android-sdks\platform-tools\;C:\Documents and Settings\xp\android-sdks\tools\. If all successful, now, you will have no "Failed to install HelloAndroid.apk on device", but on Eclipse->Show View->Console, you will be prompted with these lines:

    [2011-11-19 14:24:38 - HelloAndroid] Success!
    [2011-11-19 14:24:39 - HelloAndroid] Starting activity com.tck.HelloAndroid.main on device emulator-5554
    [2011-11-19 14:24:45 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tck.HelloAndroid/.main }.
    Regards

    ReplyDelete
  8. Thnx a loooottttt!!!
    it worked n i m very happy....

    ReplyDelete
  9. Hi,

    I would like to know, what is the name of the environment variable o change ? I didn't found it.

    Thank you,

    --
    A new android developer...

    ReplyDelete
  10. PATH.

    edit it and add the required path to it.

    ReplyDelete
  11. Bravo! Thanks for the time to post this! :D

    ReplyDelete
  12. You are an absolute life saver....I've been stuckk for weeks with this problem. THANK YOU

    ReplyDelete
  13. I've been trying everything to get this working the past few hours. was very sketchy about changing the path, but it worked, thank you!!

    ReplyDelete
  14. Thanks! After hours of searching, finally a working solution!

    ReplyDelete
  15. Thank You so much!!
    Its working!!
    Yippie :)

    ReplyDelete
  16. what a great job :) ,, since 4 days i am searching for this, but no solution, :) but thank you :) to solved my problem

    ReplyDelete
  17. it's worked, thank you so much...

    ReplyDelete
  18. It worked! After hours searching for a solution this solved my problem. Thank you very much for submitting.

    ReplyDelete
  19. That worked for me too....thanks a ton!!

    ReplyDelete