Cannot install apk when the app is already installed from Playstore
Asked Answered
B

4

7

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

Basilio answered 20/2, 2018 at 10:21 Comment(3)
yeah it will not install you need to uninstall the existing application first and still you want install both application existing and new version you have to change your pacakge name .Accomplishment
But, I want to test the update (DB migration). Need to test it in the real time. Any other way...? @AccomplishmentBasilio
no other way you have to uninstall existing apk then you can install the latest (signed) apk .You can not migrate apk like thatAccomplishment
M
2

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.

Maes answered 20/2, 2018 at 17:33 Comment(3)
Thanks for the answer @Nick Fortescue! I'm sure that the signature keys are same. (I've compile the signed apk with the same .keystore file). That's why I'm more confused...Basilio
You might be sure, but have you double checked? I've seen lots of developers think they know what they are doing with signatures and get it wrong. There are a lot of ways here: #17424370 of getting your certificate hash. Get them from both the installed APK and the APK you are trying to install, and check they match.Maes
Thank you @Nick Fortescue! I'll check the hash values of the apks.Basilio
M
0

I have faced the same problem. Easiest way to test version migration, is uninstall the play store version, install old apk, (login, update datas etc), and then finally install the newest apk.

So be sure that you keep old versions of your application somewhere.

Miniaturize answered 18/12, 2020 at 7:5 Comment(0)
R
-1

First of all uninstall the current app from device and follow the below steps :

  1. Go to Settings
  2. Go to Apps
  3. Now scroll down to your app and tap on your app.
  4. On the upper left corner tap on Overloaded menu (3 vertical dots).
  5. Tap on Uninstall for all users.

Now install the new app.

Rapture answered 20/2, 2018 at 11:14 Comment(1)
Thanks for the answer @Pranay Soni! I need to test the upgrade of the app in real time. Not uninstall/install.Basilio
T
-1

The easiest way to do this is to use the following ADB command:

adb shell pm uninstall <package name>

I have tried it and it works. After executing this command, try installing from playstore, you will be able to install

Teddman answered 10/6, 2020 at 7:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.