1

Hello guys I'm not able to install APK After adding android:sharedUserId="android.uid.system" this in manifest file

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx"
android:sharedUserId="android.uid.system">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="com.honeywell.decode.permission.DECODE" />

as It shows in Run tab error Error: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Reconciliation failed...: Reconcile failed: Package com.xxx has no signatures that match those in shared user android.uid.system; ignoring!

you can check it in below

2/21 16:00:06: Launching 'app' on Nexus One API 29. Installation did not succeed. The application could not be installed: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE

List of apks: [0] 'D:\Working\xx\app\build\outputs\apk\debug_1.5.apk' Installation failed due to: 'Failed to commit install session 881743286 with command cmd package install-commit 881743286. Error: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Reconciliation failed...: Reconcile failed: Package com.xxx has no signatures that match those in shared user android.uid.system; ignoring!'

Omkar
  • 3,040
  • 1
  • 22
  • 42

1 Answers1

1

The reason is that You use this

android:sharedUserId="android.uid.system"

without signing the APK file with a system signature for this device. You have to obtain a system signature file for the specific vendor and sign Your APK file with it. In my experience the manufacturers will not share the system signature file. If Your app is intended to be used on general smartphones - you should avoid using a sharedUserId, unless you are working in a close collaboration with device manufacturers and they will sign the apk for you. In case you still need to test your app as a "system app" just make image with AOSP for some emulator or SBC and then you will be able to use AOSP's system signature file.

Pavel B.
  • 805
  • 10
  • 13
  • Thank you for your help, actually I'm not aware about such process... I tried to apply this https://stackoverflow.com/a/50240471/6834114 solution to my app to resolve ```Sending non-protected broadcast com.honeywell.intent.action.SCAN_BUTTON from system 2416:com.honeywell.devicemonitor/1000 pkg com.honeywell.devicemonitor``` this error in my app. – Omkar Dec 21 '21 at 11:40
  • can I use ```android:sharedUserId="com.honeywell.devicemonitor"``` instead ```android.uid.system``` ? – Omkar Dec 21 '21 at 11:44
  • 1
    You will still need a signature file from "com.honeywell.devicemonitor" and you will get the same linux userId as that process, which means that you will have same permission level as "com.honeywell.devicemonitor" application. – Pavel B. Dec 21 '21 at 12:45
  • I facing ```Sending non-protected broadcast com.honeywell.intent.action.SCAN_BUTTON from system 2416:com.honeywell.devicemonitor/1000 pkg com.honeywell.devicemonitor``` this issue and for resolving this I thought **sharedUserId** will resolve... :D – Omkar Dec 21 '21 at 12:48
  • That would fix the issue but it will also make your app a system app... – Pavel B. Dec 21 '21 at 12:49
  • okay... is there any delimits or consequences if make my app as System app? – Omkar Dec 21 '21 at 12:51
  • I m not sure, but it seems that you cannot distribute it through Google Play Store. – Pavel B. Dec 21 '21 at 12:53
  • hmmm then will think about it before doing that BTW thanks for your time... :) – Omkar Dec 21 '21 at 12:54