Reputation: 141
The error message displayed by F-Droid was on the lines of"The new package is requesting a shared user which is already installed on the device and does not have matching signature.". The eror code was INSTALL_FAILED_SHARED_USER_INCOMPATIBLE / -8.
When trying to install the app "Termux" from F-Droid. Essentially installing the apk and not from the Play Store.
I previously had the app installed from Play Store and then uninstalled it before trying to reinstall it from F-Droid. This is the most probable cause in my opinion although I wasn't able to reproduce it on another device.
(Preempting my answer) As it turns out /data/system/packages.xml still contained the shared-user entry for the app including the signature. Which explains why I couldn't install the other apk, since they were signed with different key although they're the same apps and opensource.
Upvotes: 3
Views: 5512
Reputation: 131
Problem solved without root access:
I also encountered 'Error (-8): The new package has requested a shared user which is already installed on the device and does not have matching signature." after uninstalling termux in Google Play and attempting to reinstall it from F-Droid.
The phone was not rooted, so the solution suggested above was not available. However I noticed that some accompanying termux apps were still installed, namely termux API, termux tasker and termux styling.
After uninstalling them, as well as emptying the cache and/or data (via android settings) of possibly relevant system apps including google play store (C), google play services (CD) and package installer (CD), I was able to install termux, along with the accompanying apps, from F-Droid.
C: app cache emptied; CD: app data also deleted
Upvotes: 3
Reputation: 141
Warning: This is quite a brachial method to solve this issue. It also requires root access.
Based on one answer on xda-developers by the user tweakradje I have found the following to work for me:
Copy /data/system/packages.xml to another location or your computer.
Edit it with a text editor and remove the xml-block that has the the apps package-id as the name attribute. Example for the app "Termux" in this case:
<shard-user name="com.termux" userId="10102">
<sigs count="1">
<cert [...]/>
</sigs>
</shared-user>
Copy the modified version to /data/system/packages.xml and overwrite the old one.
Clear the dalvik cache ("adb shell rm /data/dalvik-chache/*" or via recovery)
Reboot
Install the apk which should go through this time
This most probably won't work for system packages (those that start with "android", e.g. "android.uid.system").
Upvotes: 2