0

The context of my issue is the following:

  1. I build AOSP for our hardware device on Linux
  2. Together with the system, I build an APK as a system application
  3. Everything works fine in this setup when I flesh it together with system image

However, I would like to have this application build separated from the AOSP build and be able to build it standalone and install from Windows.

On windows, I am trying to build it with Gradle And the problem arises when I try to push the build to the device the following way:

adb install -r my_app.apk
adb: failed to install my_app.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package <...> signatures do not match the previously installed version; ignoring!]

Obviously the error means that I am missing a platform signature in the application, but where to take it from the AOSP build and how to sign it with Gradle build is not so clear.

Also here I found an advice to uninstall the system app first before installing. Unfortunately, for my case it does not help, the error is still the same even I uninstall it first.

I already spend quite some time on this, searching in the Android make-files for the signing script, but it seems to be not that straight forward there.

Any help would be highly appreciated...

1 Answers1

1

Create a keystore from platform.x509.pem and platform.pk8 files located in build/target/product/security. Then use that with gradle.

See this answer for how to do the conversion: https://stackoverflow.com/a/22214826/3801327

Note: Don't use the default keys included with AOSP, everyone has those, and would be able to make their app a system app in your platform. Generate your own keys.

Rick Sanchez
  • 4,528
  • 2
  • 27
  • 53