INSTALL_FAILED_SHARED_USER_INCOMPATIBLE Solution

Reason for error: This attribute android:sharedUserId="android.uid.system" is declared in the manifest file .

The reason why this attribute is declared is that developers hope to upgrade the APP they develop to a system-level APP, so that it can have the functions of a system-level APP, such as closing the functions of other APPs.

Below I describe how I solved this problem (promoting the APP to a system-level APP):

1. Add attributes to the manifest file

android:sharedUserId="android.uid.system"

2. Add system permissions to the manifest file, such as:

<uses-permission android:name="android.permission.FORCE_STOP_PACKAGES"

tools:ignore="ProtectedPermissions"></uses-permission>

3. Use Android system signature to sign the APP.

(1) Download the unsigned apk installation package.

(2) Obtain the system signature files, platform.pk8 and platform.x509.pem. These two files are in the Android system source code. The path is as follows: android/build/target/product/security/

(3) Prepare the signature tool signapk.jar. This file is in the Android source code. The path is as follows: android/prebuilt/sdk/tools/lib/

(4) Place the unsigned apk, signature file, and signature tool in the same path. Open the terminal, cd to the directory, and run the following command to get the signed apk.

java -jar signapk.jar platform.x509.pm platform.pk8 demo.apk signdemo.apk

(5) Run the following command to install the signed apk.

adb install D:\signadts.apk

At this point, the problem I encountered was successfully solved.

Guess you like

Origin blog.csdn.net/woyaoxianzaixiazai/article/details/129122913