27

Getting an error message while trying to run an apk through android studio 3.4 canary 1.

Gradle plugin version com.android.tools.build:gradle:3.4.0-alpha01

Installation failed with message Failed to commit install session 526049657 with command cmd package install-commit 526049657.. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

I have tried uninstalling the apk, restarting android studio and the device and invalidating caches and rebuilding but nothing seems to work.

2
  • 1
    This seems to be an issue with android studio 3.4 canary 1, I reverted to 3.3 beta 1 and everything works fine. Oct 23, 2018 at 15:45
  • 2
    I had the same problem and found the solution here stackoverflow.com/a/42695197 Nov 25, 2018 at 9:26

10 Answers 10

30

I disabled "Instant Run" in settings, and it works for me.(Android Studio 3.4 canary)

picture

Then you can see the adb command executed in the terminal is "adb push", while it is "adb install-multiple" before that is disabled.

4
  • This also solves others commit install session error like pm install-commit and INSTALL_FAILED_INVALID_APK error code.
    – stramin
    May 14, 2019 at 12:58
  • Thanks man. You saved my life. I simply don't understand why even Google launched this feature if it is not stable. Leading to time wastage of Android devs. Phew.
    – Perry
    May 29, 2019 at 6:45
  • This worked for me today with a clean install of 3.4. Thank you!
    – RichieHH
    Jun 4, 2019 at 14:41
  • @Jude Fernandes This does seem to be a solution (worked for me). You should try it and possibly selected it as the solution to your question.
    – osprey
    Aug 1, 2019 at 18:38
15

On Android studio go to build menu : Build menu

Then:

  1. First Clean
  2. Rebuild
  3. run it again

*******It works well **********

1
  • After performing the above 3 steps, It didn't work until I restarted my system! Mar 30, 2023 at 17:39
11
  1. build->clean project

  2. rebuild project

  3. Delete as shown below

enter image description here

2
  • 1
    Deleted the app/build directory alone and then run. It works fine for me.
    – Dinesh
    May 8, 2019 at 8:16
  • 1
    Just doing "build->clean project" did it for me.
    – Veda
    May 11, 2019 at 11:06
3

Disable "Instant Run".

File->Setting->Build, Execution, Deployment->Instant Run-> unCheck (Enable Instant Run to hot swap code/resource changes on deploy)

and Run your Project and after that go and Enable Instant Run to use the advantages of Instant Run

1
  • 1
    I face this problem again,tnx myself:)))) Jul 27, 2019 at 10:17
1

If you have a version of the APK installed on a device/emulator and you create a new version of the APK that compiles against an SDK above the device/emulator sdk, you get this error vs. the original "yo, you are targeting 28 and this device has 26... come one, you need a 28 device/emulator".

You have to actually turn off instant run to see the right error.

Why would you do this? Good question! I mixed up my Q vs P devices and wasted an hour trying to figure out what was going on. :P

0

Most easy solution is, wipe data of your emulator and run project again.

0

I had fixed this problem by getting rid of the meta data section in my manifest. I have no clue how it was added to the manifest to begin with (I'm a noob), but once I removed it from the manifest, the app loaded right up.

<Activity

... />

remove the meta data line within the manifest and it should work.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Dec 14, 2021 at 7:27
0

This is what worked for me

Build > Clean Project

File > Invalidate Caches & Restart

0

Just checked In AndroidMainfest file is not complaining any issue. I have updated targetSDK version 33 and it required "android:export" flag in activity section

0

Follow these steps when you connect through USB, it resolves your problem, App easily install

steps you should follow:

Turn on -> USB debugging

then:

Turn on -> Install via USB
Turn on USB debugging (Security settings)

enter image description here

New contributor
Brahmajyoti Nayak B 221210135 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

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

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