nhoxbypass
nhoxbypass

Reputation: 10152

App installation failed with message: Failed to commit install session

Yesterday my app was running perfect from Android Studio. But today when I upgraded to Android Studio 3.4 Canary 6, I started getting the following error message continuously:

Installation failed with message Failed to commit install session 1249295977 with command cmd package install-commit 1249295977.

It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

Error dialog:

Application installation failed

When I click OK and then re-Run, I get this error message.

Session 'app':Error Installing APKs

I tried to manually delete the app, but it's already deleted from my phone. Restarting Android Studio, invalidating caches and rebuilding are not working either.

Upvotes: 8

Views: 15558

Answers (4)

VIKAS SHARMA
VIKAS SHARMA

Reputation: 76

Most easy way to solve this is, wipe data of your emulator and run project again.

Upvotes: 0

Slava
Slava

Reputation: 1302

In my case, there was not enough space on the cellphone. I've got a clear error message when I tried to install the app manually via ADB:

$ ./gradlew installDebug

> Task :app:installDebug
07:23:47 V/ddms: execute: running am get-config
07:23:47 V/ddms: execute 'am get-config' on 'R58M45K5MPZ' : EOF hit. Read: -1
07:23:47 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'SM-A205F - 9' for app:debug
07:23:47 D/app-debug.apk: Uploading app-debug.apk onto device 'R58M45K5MPZ'
07:23:47 D/Device: Uploading file onto device 'R58M45K5MPZ'
07:23:47 D/ddms: Reading file permision of /home/egslava/temp/android-projects/RedditTestFeed/app/build/outputs/apk/debug/app-debug.apk as: rw-rw-r--
07:23:48 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
07:23:56 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'R58M45K5MPZ' : EOF hit. Read: -1
07:23:56 V/ddms: execute: returning
07:23:56 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
07:23:56 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'R58M45K5MPZ' : EOF hit. Read: -1
07:23:56 V/ddms: execute: returning
Installed on 1 device.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

Upvotes: 0

Rasoul Miri
Rasoul Miri

Reputation: 12222

check 4 ways:

way 1: turn off Instant Run

File > Settings > Build,Execution,Deployment > Instant Run > Un-check (Enable Instant Run to hot swap code)

way 2: Go to Build --> Clean Project and Run again

way 3: For those who use Xiaomi phones, follow these steps:

Settings-> Additional Settings-> Developer opetions

Turn off MIUI Optimization and reboot your phone

Last Disable verify app over USB

way 4: Run Invalidate caches/restart in android studio

Choose the File option in windows and preference in mac
Select Invalidate caches/restart.
Click Invalidate and restart.

Upvotes: 12

Codelover
Codelover

Reputation: 265

In my case I disable Instant Run from Setting-> Build, Execution, Deployment ->Instant Run

Upvotes: 4

Related Questions