Reputation: 2324
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
Reputation: 469
Upvotes: -1
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
Reputation: 7222
In Android Studio from build menu:
1. Clean Project
2. Rebuild Project
This solved the same issue for me...
Upvotes: 4
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: Preferences → Build, Execution, Deployment → Uncheck Enable Instant Run to hot swap code/resource changes on deploy.
Upvotes: 5
Reputation: 21
I got this error after copying an existing app. This helped:
build.gradle
Under (module:app).build.gradle
, check under defaultConfig
,
change the applicationId if it still refers to the original project you copied.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
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:
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
Reputation: 109
In AndroidManifest.xml you should add android:installLocation="preferExternal"
above <application ... />
.
Upvotes: 0
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
Reputation: 639
I got this error after adding a signing config.
Solved it by deleting the build folder::
Upvotes: 1
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
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
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
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
Reputation: 199
Disable the Instant run in Android Studio and then Clean,Rebuild and Run ,It should fix this issue.
Upvotes: 11
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).
Upvotes: 4
Reputation: 1623
Am also faced same problem. It can be solved.Delete the below mentioned directories and restart AndroidStudio.Run the application.
Upvotes: 13
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
Reputation: 2324
I was able to solve this by doing:
Upvotes: 1