neonDion
neonDion

Reputation: 2358

android: Failed to install .apk on device "device": timeout

A few days ago I started having troubles while trying to install a .apk on my Galaxy S2. I select my phone as the target, click OK and in the Console get the following error:

Failed to install AvatarRun.apk on device 'device number': timeout Launch canceled!

Without changing anything in code and running again I can also get the error:

Failed to install AvatarRun.apk on device 'device number': device not found com.android.ddmlib.InstallException: device not found Launch canceled!

I have tried opening a command window and navigating to android-sdk\platform-tools and running:

adb kill-server adb start-server

This did not fix the issue.

This seems to just be a coincidence, but after failing many times I changed the minimum SDK in the Manifest from 10 to 7 and the .apk loaded on the next try, but has worked intermitently since and generates the same errors.

Can anyone suggest a method for finding what is causing this error?

Upvotes: 5

Views: 20371

Answers (5)

Vallabh Patade
Vallabh Patade

Reputation: 5110

There are various solutions:

  1. Try changing the ADB connection timeout. The default is 5000; you should change it to 10000ms or so.

    Window -> Preferences -> Android -> DDMS -> ADB Connection Timeout (ms)

  2. Try to unplug and re-plug the cable. It seems that sometimes Eclipse loses the connection with Device. Sometimes you just need to plug into other USB port.

  3. You might need to kill the ADB process and restart it.

    adb kill-server and then adb start-server

Upvotes: 5

user2953067
user2953067

Reputation: 19

This problem often shows up if the computer is not fast enough. So,if you go to task manager you will see the performance. If you are watching video or running other programs at the same time while you are running your android application close other programs; at least during installing the app on device or emulator. You might even need to close internet browser.

You might need to update your computer to make it faster if you can.

Hope this helps someone:)

Upvotes: 0

ZijunLost
ZijunLost

Reputation: 1614

It may sound ridiculous, I tried all the ways suggested in Android error: Failed to install *.apk on device *: timeout

None of them works for me except unplugging the current cable and change for a new one.

Upvotes: 7

hengxin
hengxin

Reputation: 1999

For me, the solution is to uninstall the old apk from the phone.

Upvotes: 3

neonDion
neonDion

Reputation: 2358

After trying the fixes mentioned above, I ended up installing and reinstalling the Galaxy drivers. This didn't help. What eventually worked (so far) was to switch which USB port the Galaxy is plugged into. Once I did this everything was functioning as it should.

Upvotes: 17

Related Questions