8

Usually I build an app in Android Studio to test an app on Phone. But this occurs when I just click the Run app

Waiting for device.
Target device: motorola-nexus_6-ZX1G227B86
Uploading file
    local path: F:\HeadFirstAndroid\MateClient\app\build\outputs\apk\app-debug.apk
    remote path: /data/local/tmp/com.diyu.org.mateclient
Installing com.diyu.org.mateclient
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.diyu.org.mateclient"

It seems that the process is stuck on the pm install and no app is installed on my phone. What's the issue?

And other projects acts the same, hang on the install.

3
  • How large is the apk it is installing? Apr 25, 2015 at 16:49
  • It is a very small project, and usually it starts very quickly. What I did from last successful build is just add several images and lines of codes. Actually this happens even I change another previous project.
    – chrisTina
    Apr 25, 2015 at 16:51
  • 1
    Try restarting the phone, restarting android studio and stopping the adb service Apr 25, 2015 at 16:53

14 Answers 14

17

I fixed this issue by going to Settings on the device -> Developer Options -> uncheck "Allow USB debugging' -> Recheck box. And next time, the software started correctly.

4
  • 1
    But well, then, usb debugging will be disabled? Jun 3, 2016 at 14:27
  • 1
    You check and then uncheck the box. So USB debugging will be enabled. Nov 2, 2016 at 14:07
  • It's 2022 and I still have to do this every single time. Android Studio is such a garbage of a software. Nov 15, 2022 at 1:51
  • Life Saver! It's sometimes so annoying Apr 18 at 7:42
8

I was stuck on install. Restarted the phone, and it worked.

4

In my case the device was the problem. It refused any install or uninstall commands. You can easily test this via the adb command adb install [your apk file] If the command line is stuck too, than this means that it is not "studios fault". Also an uninstall returned Failure [DELETE_FAILED_INTERNAL_ERROR].

There must be something wrong with the installation-state inside of android.

I was able to solve this issue by manually installing my app via an apk file that I dropped into my sd card. Then I used adb uninstall [my_package] which resulted in Success.

Finally I could install my application from Studio as normal.

3

In my case, just run (Mac: ^R, Windows: Shift + F10) again solved the problem.

2

I fix this issue by unplugging the phone and re plugging it. If the problem persists, there may be something wrong with your drivers/USB cable or the ADB service.

1
  • Yeah, it worked for me. I tried out two different cables and one worked well but the other didn't.
    – Gompro
    Aug 28, 2018 at 6:41
1

In my case to solve the install hanging, I performed the following:

  • ran flutter clean
  • turned off wireless debugging on my phone
  • connected the phone via USB
  • ran the app

The app installed correctly, after which I stopped the app. re connected wirelessly then it installed and ran correctly

0

i think the problem is in the size of your Dex, uninstall your app from your devise first then try cleaning your project,and run your project without pictures

0

I fixed this issue by updating the OS to the latest Android version

0

I fixed this issue by closing the project and reopening it. But I know this is not the only solution/may not always work.

File > Close project and then reopen the project.

0

Might be a bit late.

The only thing that solved this for me was device reboot. Once I restarted the problem was on LG G4c and once I restarted it everything went back to normal.

0

If by any chance you are using Xiaomi phones such as Redmi or whatever, you should try to toggle the "Install via USB" option.

For me, when I disabled and again tried to enable it, it gave me the error "The device is temporarily restricted". This was preventing me from installing apps and is the reason android studio was stuck at "installing apk".

So fix this, use a VPN to connect so any chinese server, preferably shanghai, and then try to enable the "Install via USB" option. Other users reported that turning of WiFi and using mobile data to enable the option also works.

0

Check if your device has multiple user accounts. cause when android studio tries to install app on pyhsical device it installs it on all accounts. and if you uninstalled your app from your account but not from others, android studio will try to update existing app, which you don't have.

So, uninstall app from all accounts and then try to install.

0

On Redmi phones. If you do have a second space in your phone, the android studio probably installed the app in that space.

Delete the app from the second space then try again. Worked for me.

1
0

In my case it was because my phones had multi profiles enabled, and the debug app couldnt be uninstalled for all users... I had to disable multi profile support on the phone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.