Solution to the problem of installing Android APP signature on i.MX6Q development board

Single Board Computer: OKMX6Q-C OS: Android

The following operations have been successfully verified on the Forlinx Embedded Cortex-A9 i.MX6Q development board, please refer to other platforms.

When using the APP source code in the Android source code as a reference to make an Android application, it cannot be installed on the development board. The debugging information in eclipse is as follows:

Installation error: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE

This is because the system permission is set in the AndroidManifest.xml file in the APP source code, as follows:

<? xml   version = "1.0"   encoding = "utf-8" ?>

< manifest   xmlns:android = "http://schemas.android.com/apk/res/android"

     package = "forlinx.example.app"

     android:versionName = "1.0"

     android:versionCode = "1"

android:sharedUserId= "android.uid.system"   /*set system permissions*/

(Apps developed by yourself can also set system permissions in this way)

After the system permission is set, the compiled APP needs to be signed by the system to be installed and run normally.

There are two signing methods:

One method:

1. Modify the Android.mk file and add the line LOCAL_CERTIFICATE := platform

2. Use the make command to compile, and the generated apk can be run on the development board

This is also the method used by the APP in our source code

Second method:

This one has also completed the test, the test uses the source code of CanTest

1. Use eclipse to compile the corresponding apk file ForlinxActivity.apk, but this apk file cannot be used.

2. Use the SignApk.jar signature tool to sign the apk

First copy the three files platform.pk8, platform.x509.pem and Signapk from the Android source code, and then copy the compiled apk file to the same level directory.

Open cmd.exe of Windows, then switch to the directory where the apk is located, and enter the following command:

signapk.jar  platform.x509.pem platform.pk8 ForlinxActivity.apk new.apk

After execution, new.apk is the signed file, and this new.apk can be installed on the iMX6Q development board.