Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
426 views
in Technique[技术] by (71.8m points)

android - Manually installing an updated APK fails with "signatures do not match the previously installed version"

I've built a silly app to share among a few friends. No need to put it up on the app-store.

I built the first apk (signed), uploaded it to a web-server and all worked well.

A small issue arose, I fixed it, re-built, signed with the same keystore and uploaded it again. It now seems that I am unable to install from the new apk. The debugger tells me:

signatures do not match the previously installed version

So I uninstalled the old version by opening the app drawer and dragging it onto the "uninstall" button. When opening "Settings -> Apps", I don't see it anywhere anymore. I don't see any traces of the app on my device.

Yet I still get the above error message.

Is it possible some information still lingers on the device somewhere? Is there any way I can verify that?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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:Usersmyappappuildoutputsapkmyapp.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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...