0

I am updating a version of an app, both apps have same package id.

My testing:

App version 2 goes through installation having version 1 already installed on android 4.4 and 5. No problems occur.

App version 2 goes through installation having version 1 already installed on Android version 6 and above. It tells me installation fails. The installation can complete if version 1 is uninstalled first.

I'm guessing there is some system setting to allow old apps be overwritten by updated apps with same package name for Android 6 and above?

Artem Mostyaev
  • 3,874
  • 10
  • 53
  • 60
  • https://stackoverflow.com/questions/28076751/how-to-automatically-uninstall-android-app-from-device-before-installing-a-new-v/28077408 is this what you mean? – 476rick Dec 14 '17 at 10:15
  • This happens when you install the app indirectly(via copying to device) and the APKis built on debug mode. So if you install the debug mode APK over release mode built APKit will fail to override the pre-installed app. – Abhilash Maurya Dec 14 '17 at 10:16
  • Possible duplicate of [How to automatically uninstall android app from device before installing a new version](https://stackoverflow.com/questions/28076751/how-to-automatically-uninstall-android-app-from-device-before-installing-a-new-v) – aki Dec 14 '17 at 10:21
  • @476rick Not exactly, because on Android 4.4 when I install new version it installed normally even if I had the old version already installed. Also try your suggestion but still failed. – testingwebsocket Dec 14 '17 at 10:41
  • @Abhilash Maurya Its a release build. – testingwebsocket Dec 14 '17 at 10:49
  • @aki I testing the suggested solution but failed. The problem is not exactly the same because this problem only applies to android 6 and above. Android 4.4 and 5 does not have this problem. – testingwebsocket Dec 14 '17 at 11:22
  • When you the update via the Google Play Store I don't think there will be a problem. I think the way you do it there is a conflict in permissions. I once had that problem. – 476rick Dec 14 '17 at 11:37
  • Try installing on the Android 6 device via Android studio, then you will get a error message before it will override the app. – 476rick Dec 14 '17 at 11:38

1 Answers1

0

Found solution after tracing log.

W/PackageManager: Package com.some.package new target SDK 22 doesn't support runtime permissions but the old target SDK 24 does.

The new versioned had a lower build target than the old version. Once I changed the build target. It worked.