Android Failed to install HelloWorld.apk on device (null) Error

前端 未结 22 1628
走了就别回头了
走了就别回头了 2020-11-28 23:37

I am new to Android. When I am running my android application in eclipse I am getting these messages in the console:

[2011-03-08 12:57:35 - HelloWorld] ----         


        
相关标签:
22条回答
  • 2020-11-29 00:23

    If you are running it on an Android Emulator you do not want to close it between runs. The system will try to load the app and it will time out because of how long it takes the emulator to boot up. You can fix this by increasing the ADB time by going to Window -> Preferences -> Android -> DDMS and increasing the ADB time out (default is 5000ms) or by leaving the emulator open and just running it after the emulator is up and running.

    I personally would recommend leaving the emulator open as it does load the apps relatively quickly once it is running, but it could be a drain on the system. Do whichever would help you more.

    0 讨论(0)
  • 2020-11-29 00:23

    I ran into the same problem and tried increasing the ADB connection timeout... Didn't work.

    I tried putting the "android-sdk/tools" and "android-sdk/platform-tools" in the PATH variable.... No effect.

    I tried restarting Eclipse and letting the AVD startup before running. Same problem.

    I can sometimes get it to work with a combination of closing and reopening the project, followed by cleaning and rebuilding the project. It doesn't always work, but since I didn't restart the AVD this last time, I think the problem lies within Eclipse itself. You might try deleting everything in the "bin" directory of your project and then cleaning and rebuilding. It might be some temporary or intermediate files not getting deleted properly. Another thing I had to do was delete my AVD. It didn't delete properly, and I had to go in and manually delete the AVD's subfolder and then re-create the AVD. Some combination of these clears the problem up temporarily. Hope that helps.

    0 讨论(0)
  • 2020-11-29 00:24

    What Jichao said always works for me.

    Generally when I see this error if I am using Eclipse I will close and reopen the program. I will then uninstall the Application from the target phone. This sometimes fixes the issue but not always.

    Next I will open up the command terminal and head into the android-sdk then run:

    ./adb install <AppName>.apk
    

    This does the same thing that running through Eclipse does but it will give you an error message.

    (9 times out of 10 it simply says 'INSTALL_ALREADY_EXISTS' and I go and uninstall the application off the target phone again then run adb and I am working fine.)

    0 讨论(0)
  • 2020-11-29 00:25

    I was getting the same errors with my devices.
    First be sure that you do not upload debug apk to a device having already installed the same apk but signed with release cert. In this case you've got to uninstall it first from the device.
    In other cases my solution is to reboot everything:

    1. reboot device
    2. pskill emulator-arm.exe
    3. pskill eclipse.exe
    4. pskill adb.exe

    After that the device, adb and eclipse are working.

    0 讨论(0)
提交回复
热议问题