Manually installing an updated APK fails with "signatures do not match the previously installed version"
Solution 1:
Yes It is possible if somehow your old application is not removed 100% or its data is not removed.
Try:
adb uninstall "com.yourapp.yourapp"
If you don't know exactly what to put as replacement for "com.yourapp.yourapp", then you just open Android studio, Run your app while it is connected to a device and then look at Debug window.
It says:
Waiting for device.
Target device: samsung-sm_t531-xxxxxxxxx
Uploading file
local path: C:\Users\myapp\app\build\outputs\apk\myapp.apk
remote path: /data/local/tmp/com.myapp.myapp
Installing com.myapp.myapp
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.myapp.myapp"
pkg: /data/local/tmp/com.myapp.myapp
Success
com.myapp.myapp in this case is the name of the package you must use to uninstall.
Solution 2:
I had the same issue and the adb uninstall
solution did not work for me.
What worked was
- On your device go to to Settings->Apps
- Select your app, and in the menu select "Uninstall for all users"
Even if I had previously uninstalled the app it was still in the list there.
Solution 3:
To me, if the app is meant to be distributed, the adb
solution is a no-go: you can't ask one's friend to have the android sdk installed on their machine !
The way to go here is to edit the AndroidManifest.xml
and to increment the android:versionCode
attribute in the <manifest>
tag (which is the root element).
This would update your installed application
Solution 4:
If you are seeing this while conducting connected tests, make sure to include .test when uninstalling via adb because uninstalling via app -> settings does not get rid of the test package
adb uninstall your.broken.package.test
if you just uninstall via
adb uninstall your.broken.package
your test package will still be there. This was only something i noticed while using the gradle command line, haven't come across this problem within android studio