13

In the recent times I am considering to change my work title from "Android Developer" to "Endless install progress watcher".

It has been happening ever more often that when I try to run my applications or tests Android Studio stucks in endless installing progress like the image below:

enter image description here

This progress remains like forever. It used to be that if I disconnect my device and connect again the next attempt will succeed. Now it is often the case that I need multiple re-connects until I am able to run.

The speculation is the problem is due to ADB hanging and loosing connection somehow, but I do not know how to overcome that.

My configuration is: - Ubuntu Linux, but colleagues experience the same on Mac OS e.g. - Android Studio 3.5 - device is Nexus 5X, but the same happens on many other devices

Boris Strandjev
  • 46,145
  • 15
  • 108
  • 135

6 Answers6

1

Try if any of this this solves your problem:

  1. Clean project
  2. Use another device
  3. Go to developer options -> Select debug app -> Turn on "wait for debugger" -> Run your app again
  4. In Developer Options turn off "Monitor apps installed by ADB".
  5. Reboot your phone
  6. Reinstall Android studio
Tomaz Mazej
  • 465
  • 5
  • 19
1

You may need to try: File -> Settings (Android Studio -> preferences for mac) -> Build,Execution,Deployment -> Instant Run and turn it off.

Fulton
  • 56
  • 1
  • 6
  • Are you using latest Android Studio. I do not seem to be able to find this option – Boris Strandjev Sep 25 '19 at 10:04
  • It changed! ok just look it up in your settings if that does not work look at this driver list [https://developer.android.com/studio/run/oem-usb#Drivers](here) – Fulton Sep 25 '19 at 14:18
1

I had this same problem. I solved it by revoking USB Debugging Authorizations and then re-enabling USB Debugging on my chosen device(s).

1

It turns out the problem wasn't with Android Studio, but with the device you're using for testing. I tried a different device and it behaved normally, progressing beyond "Installing APK" and stopping on breakpoints.

Somehow the "wait for debugger" setting in developer options on the problem device had switched to off. I switched this back on and now this device is behaving normally.

Alfaizkhan
  • 289
  • 1
  • 9
1

You must try:

  • Latest Android Emulator Download or Update : Android Emulator version 29.2.1
  • Delete all Emulator which is created previously and Create New for Android 9 or 10.
  • Uninstall app from device if already installed previously. (Remove for all users.)

I think 3rd point will work because you have Nexus Device, Must visit above link.

Hope you will get resolve your issue. Thank you.

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
  • I am using real device. I confirm fresh install never exhibits the problem, but my problem is that sometimes I need to preserve the installation in between runs, thus I can not afford always uninstalling – Boris Strandjev Sep 25 '19 at 10:05
1

This seems to happen sometimes if you have multiple user accounts on your device. If you uninstall it from the device, it might still be installed for other users and therefore Android Studio can't install the new APK.

Try to do the following (even if the app is not visible on your device!):

adb uninstall <package_name>

If you have seen a success message, that means the app was successfully uninstalled and Android Studio should be able to install the app properly now.

techfly
  • 1,826
  • 3
  • 25
  • 31