简体   繁体   中英

Cannot upgrade old application by android studio generated apk file in Lollipop

I was installed old version(version 1) of my application from google play store in my phones. Now I would like to update this app to new version(version 2), so, I generated new apk file by using android studio and I upload this generated apk to google drive. Then download and install from my several devices(Android 5.1.1, and Android 4.2.2).

In android 4.2.2, I can install the downloaded apk and my application was upgraded to version 2 successfully.

In Android 5.1.1, I can click on install button, after that show the "App not installed" error message and the application was not upgraded to new version(version 2).

Could you please give me some advice?

Please see the attachment picture of android 5.1.1 device.

在此处输入图片说明 在此处输入图片说明

I think it is bug. It happened to me once while upgrading to a new version. The problem occurs when there are 2 users in Android OS(ie Settings>Users. Probably in your case, guest user must be present). So when app was previously installed, it must be installed for both primary and guest user. So when Android OS tries to uninstall the app to upgrade, it only uninstalls app for primary user and not for guest user. So the app is still present in the OS but not for primary user preventing installation of the new app. At least this is what I think it is.(I am using a Moto G)

But I have never encountered this bug when upgrading from playstore. It only happened when trying to upgrade app by installing apk from external source. I hope it helps...

When you upgrade your application and build for release, make sure that you sign your application with the same keystore you used to sign your previous application version.

When you use new keystore to sign your new application version and attempts to install it into the device with your application(old version) already installed, android will halt the installation and you can tell exactly why it does not install by looking at the logcat.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM