Sideload an APK

United States
Canada
Europe

Your Clover app must be installed to your Sandbox test merchant before it can use Clover services such as OrderConnector in the Clover Android SDK. Use your sandbox test merchant's web dashboard on your Dev Kit device to install your app. Installing your app to your sandbox test merchant causes the Clover device to download additional metadata about your app, allowing it to use Clover services.

When you install your app on your Sandbox test merchant, your device downloads and installs your APK. If you attempt to sideload a development version of your APK on top of the downloaded app, it will fail with a message like the following:

$ adb install -r test.apk
    1 file pushed. 6.4 MB/s (887871 bytes in 0.132s)  
        pkg: /data/local/tmp/test.apk
    Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

Your attempt to sideload fails even if you are signing your APK with the same certificate that you used to sign the APK that is uploaded to your Sandbox developer console. This is because Clover adds additional signatures to your APK when it is uploaded to the Sandbox developer console. While your certificate proves you authored the app, the second certificate is used to prove additionally that the app came from the Clover app store. Because your app is double-signed when you download it from the Clover App Market, its certificates don't match what you signed locally in your development environment.

Sideload workaround

Follow these steps to workaround this certificate problem while you are doing development work:

  1. Make sure your app is already installed and downloaded from the Clover App Market.
  2. Manually uninstall the Clover App Market double-signed APK from the device using the adb uninstall command.
$ adb uninstall com.example.test
Success
  1. Manually install your developer single-signed APK using adb. Make sure that the version code in your sideloaded app is higher than the version code in the app that you uploaded to your dashboard. Using a lower version code makes the Clover App Updater think that the APK must be upgraded. The Clover App Updates tries to download and overwrite the previous APK.
$ adb install -r test.apk 
    1 file pushed. 6.4 MB/s (887871 bytes in 0.133s)
        pkg: /data/local/tmp/test.apk
    Success
  1. If you make changes to permissions for your app on the Developer Dashboard you may manually sync the device by tapping the sync button in the upper right corner of the Clover Help app.