Session 'app': Error Installing APK

234,553

Solution 1

Edit:

In newer Android Studio versions you can re-sync the project using this button:

enter image description here

For older versions:

Open Gradle window (on the right side in Android Studio) and click on the refresh button.

However it is not a 100% sure fix.

Solutions for other cases:

Open terminal window and type "adb kill-server", then type "adb start-server". Usually after a few hours of inactivity, adb used to disconnect the device. (If you don't have the sdk/platform-tools in the PATH environment variable, then you should open a terminal in that folder)

One tip if these solutions don't help you: If you open the Event Log window in the right bottom corner of Android Studio, you can see a detailed error message.

Other edge case If you see this error: INSTALL_FAILED_INVALID_APK:... signatures are inconsistent. Then unfortunately a gradle refresh isn't enough, you have to go to Build -> Clean Project and then Run again.

Issue with Android emulator If you want to deploy the APK to an Android Emulator and you see the "Error installing APK" message, your emulator may be frozen and need restart.

Solution 2

Turning off the Instant run removed my error for Androdi Studio 2017.03.03 v2.3

enter image description here

Solution 3

You have to enable Developer options and enable USB Debugging:

  1. Go to the settings menu, and scroll down to "About phone." Tap it.
  2. Scroll down to the bottom again, where you see "Build number." (Your build number may vary from ours here.)
  3. Tap it seven (7) times. After the third tap, you'll see a playful dialog that says you're four taps away from being a developer. (If only it were that simple, eh?) Keep on tapping, and poof, you've got the developer settings back.

http://www.androidcentral.com/how-enable-developer-settings-android-42

Inside Developer Options, enable USB Debugging

enter image description here

Solution 4

I fix this by delete the build folder then run project again

enter image description here

Solution 5

Try using a different version of Gradle(stable version). To summarize:

  • Check your gradle file for debuggable false/true
  • Invalidate caches & restart
  • Check your install location
  • Restart adb
Share:
234,553
Stanislav Barabanov
Author by

Stanislav Barabanov

Updated on July 05, 2022

Comments

  • Stanislav Barabanov
    Stanislav Barabanov almost 2 years

    Trying to install app on real device following instructions:- http://developer.android.com/tools/device.html. At end Android Studio giving error:

    Session 'app': Error Installing APK 
    

    I guess the problem probably can be in my android device(it is chinese Doogee X5). It does not have a given USB Vendor ID in developer docs so I decided to follow instructions with random vendor ID from HTC.

    I'm sure there is a way to run application on any android device, but yet I didn't find an answer on how to do that.

    I'm running through Linux Ubuntu 14.04 LTS

  • Stanislav Barabanov
    Stanislav Barabanov about 8 years
    Thanks, but I've done it before asking. So USB debugging is turned on while I'm getting this mistake.
  • Janki Gadhiya
    Janki Gadhiya almost 8 years
    You can comment this after having enough reputation..!!
  • Legoless
    Legoless over 7 years
    For me I had to turn it off and on again to make it work. Otherwise the fingerprint dialog would not appear.
  • Jorgesys
    Jorgesys over 7 years
    @Legoless yes my friend you are right, sometimes the first time doesn´t work apparently and you have to turn it off and on again.
  • russellhoff
    russellhoff about 7 years
    Using latest Android Studio (v2.3), suddenly stopped working and I had that annoying issue. I lost 3 days of my spare time to make it work and finally what you suggested did the trick.
  • MBH
    MBH about 7 years
    Thank you man..you just saved me couple of more hours work to find out the problem.
  • Michalsx
    Michalsx about 7 years
    I had to "Build" - "Rebuild project" after I changed debug certificate.
  • Saravanan Sachi
    Saravanan Sachi almost 7 years
    Windows 10 with Android Studio 2.3 : To open this window, File => Settings, in the left pane Build, Execution, Deployment => Instant Run
  • EsmaeelE
    EsmaeelE almost 7 years
    Why should change device type for simulation
  • anshulkatta
    anshulkatta over 6 years
    for me , disabling the instant run fixed it
  • Alperen
    Alperen over 6 years
    I'm using Xioami Mi4 and this solution works for me. But when I try it on Asus Zenfone 2, it is not necessary to disable "Instant Run". Also, you need to enable "Install via USB" in the developer options if you use Xiaomi.
  • meyasir
    meyasir almost 6 years
    Uncheck the Instant Run from File >Settings >Build,Execution,Deployment > Instant Run
  • Devendra Singh
    Devendra Singh about 5 years
    @JankiGadhiya You think so much information you can write in comment?
  • Haseeb Zulfiqar
    Haseeb Zulfiqar about 5 years
    Yes I also did so and my problem get fixed.
  • Čamo
    Čamo about 4 years
    Which emulator? I have Andy and try to fix this error but still no success.