Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install apk when the app is already installed from Playstore

I've an app in Play Store.

Now, I need to update that with an updated version. Before, pushing it to Playstore, I thought I'll check the migration with APK.

I installed existing version from Playstore. Now, I'm trying to install the latest (signed) apk. But it says, App cannot be installed.

This exact case is working with Playstore. I tried with Beta distribution. It worked correctly.

Am I missing something..?

Thanks in advance

like image 875
Vignesh Thillai Avatar asked Nov 18 '22 19:11

Vignesh Thillai


1 Answers

This is almost certainly because of signature keys. Android only allows an upgrade (instead of uninstall/reinstall) if the upgrade is signed with exactly the same signature as the original install.

If you sign the app yourself, then make sure the signature key matches the Play store version before trying the install - if you use your debug/development signing key signed APK it won't work.

If your App is enrolled in Google Play signing then this won't be possible. The best option for testing in this case is to use the Alpha track. Set yourself as the only Alpha user, and release the APK you want to test on the Alpha channel. Google will sign it for you, and deliver the update. You can then use this to test your DB update.

The other option you can do is install the old version of the app yourself (not from Google Play, signed with your debug key), then try the update, again, signed with your debug key. But whatever you do, updates only work if the APK update is signed with the same key as the original installed APK.

like image 182
Nick Fortescue Avatar answered May 01 '23 05:05

Nick Fortescue