stavros.3p
stavros.3p

Reputation: 2324

Installation failed to finalize session... Signatures are inconsistent - Android

I am trying to run my project but I get this error:

Installation failed with message Failed to finalize session : INSTALL_FAILED_INVALID_APK: /data/app/vmdl1841863905.tmp/11_app-debug signatures are inconsistent. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

If I press yes, after some seconds it just shows the same error. I tried to manually delete the application but the application is already deleted from my phone.

Upvotes: 71

Views: 77097

Answers (19)

Shahbaz Ahmed
Shahbaz Ahmed

Reputation: 469

  1. Build-> Rebuild Project.
  2. Clean.
  3. Run Specifically, It worked for me. Hopefully, the problem will solve.

Upvotes: -1

Keshav Kumar
Keshav Kumar

Reputation: 61

I solved it by deleting all old applications from the target device. Give it a try once you are using the single device to deploy all your applications.

I could not find Uncheck Enable Instant Run option in my android studio 3.6.

Upvotes: 0

Hamed Rezaee
Hamed Rezaee

Reputation: 7222

In Android Studio from build menu:

1. Clean Project
2. Rebuild Project

This solved the same issue for me...

Upvotes: 4

Snowman
Snowman

Reputation: 1543

Disable Instant run in Android Studio. Then Clean, Rebuild and Run. It should fix this issue.

To disable Instant run, do:

In Android Studio: PreferencesBuild, Execution, DeploymentUncheck Enable Instant Run to hot swap code/resource changes on deploy.

Upvotes: 5

Victor Nyale Kalama
Victor Nyale Kalama

Reputation: 21

I got this error after copying an existing app. This helped:

  1. Go to project folder, navigate to build.gradle Under (module:app).
  2. click the build.gradle, check under defaultConfig, change the applicationId if it still refers to the original project you copied.
  3. Then go to, Tools > Android > Sync Project

That worked for me. If it doesn't proceed to the AndroidManifest xml and change the label to the string resource for the new app name.

Upvotes: 2

AbelSurace
AbelSurace

Reputation: 2273

This error usually happens to me in Android Studio when I try to open a project that was moved from another path or location, also other circumstances might cause this, what works for me is:

  • menu "Build"
  • run "Rebuild Project".

Then run app on device or emulator, and error goes away. I know the error has nothing to do with this but that's what fixes it for me, try and let me know.

Upvotes: 199

calincan mircea
calincan mircea

Reputation: 5

in my case after Rebuild Project worked :D

Upvotes: 1

Anh Huynh
Anh Huynh

Reputation: 109

In AndroidManifest.xml you should add android:installLocation="preferExternal" above <application ... />.

enter image description here

Upvotes: 0

PhoenixB
PhoenixB

Reputation: 418

For me I had to restart my phone to get it to work (the app was uninstalled when I restarted my phone).

Upvotes: 0

n_r
n_r

Reputation: 639

I got this error after adding a signing config.

Solved it by deleting the build folder::

  1. Project view -> app -> build (delete this folder or all the folders under it)
  2. Clean project
  3. Rebuild project

Upvotes: 1

Teck Chuan
Teck Chuan

Reputation: 1

I got the same error as you after updating my Windows 10. What I did to make it work, was to clean and rebuild the project.

Upvotes: 0

xrnd
xrnd

Reputation: 1342

In my case I had added extra blank line after versionCode line. I kept getting version inconsistent issue. It finally went off after removing extra blank line and syncing again.

Upvotes: 0

Ravindra Pawar
Ravindra Pawar

Reputation: 477

Disable the Instant run in Android Studio. 1-Go to Settings. 2-Select Build,Execution,Deployment-->Instant Run-->uncheck Enable Instant Run to hot swap code/resource changes on deploy.

And then Clean,Rebuild and Run ,It should fix this issue

Upvotes: 2

Blaze Gawlik
Blaze Gawlik

Reputation: 347

Solution: Disable Instant Run

Android Studio > Preferences > Build, Execution, Deployment > Uncheck Enable Instant Run to hot swap code/resource changes on deploy

My issues was specifically related to a package inconsistency:

Installation failed with message Failed to finalize session: INSTALL_FAILED_INVALID_APK: /data/app/vmdel334040403.tmp/11_package_name_--dev package com.package.name inconsistent with com.package.othername It is possible that this issue is resolved by uninstalling...

Nope, not true. There was nothing to uninstall. Nothing worked. Cleaning, Invalidate Cache/Restart, deleting folders, .gradlew, restarting the device, unplugging things, etc...

Also as a tip to everyone, when you're making your package name for a project, save yourself the troubles I've had and DO NOT CHANGE IT. It's a unique identifier for your app in the play store. It's used in a lot of cloud messaging identification and deeplinking for package names.

Android Studio 3.1 Build #AI-173.4670197, built on March 21, 2018 JRE: 1.8.0_152-release-1024-b01 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Mac OS X 10.12.6

Upvotes: 9

Kunal Parte
Kunal Parte

Reputation: 199

Disable the Instant run in Android Studio and then Clean,Rebuild and Run ,It should fix this issue.

Upvotes: 11

codingnow
codingnow

Reputation: 94

I use flavor because I need publish 2 version(Person, Enterprise).

I got the same problem. My solve is write versionCode android versionName in build.gradle.(before it's in the AndroidManifest.xml).

enter image description here

enter image description here enter image description here

Upvotes: 4

Sathish Gadde
Sathish Gadde

Reputation: 1623

Am also faced same problem. It can be solved.Delete the below mentioned directories and restart AndroidStudio.Run the application.

enter image description here

Upvotes: 13

didikee
didikee

Reputation: 447

I was do this and solved it:

I uninstall MyAPP.apk,and I can't install right now. so,I install a MyAPP.apk by hand.

Now,I try to retry with Android Studio,and its worked for me.

if you face this bug,try this method ,maybe work for you too.

Upvotes: 2

stavros.3p
stavros.3p

Reputation: 2324

I was able to solve this by doing:

  1. unplug device
  2. adb kill-server
  3. adb start-server
  4. plug device
  5. Run the app from a virtual device

Upvotes: 1

Related Questions