Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • Prerequisites 

  • Building

  • Signing

  • QA Release

  • Production release

  • Debug Logs

  • Playstore

Prerequisites

Before creating any release artifacts, remember to tag the commit on Github for the codebase version that you'll use to create the release whether:

  • Library (aar) or implementation (apk)

  • Snapshot or Release version

This is helpful when one wants to revert back or check out the code base that created the specific release(s).

...

Debug logs

In production, it is bad practice to have debug logs turned on. They may carry sensitive information that was being logged during development. To ensure that the release APK does not have debug logging, add this snippet to your proguard-rules file (proguard-rules.pro). 

-assumenosideeffects

class

android.util.Log

{

public

static

***

d(...);
}

This

strips

out

debug

logs

but

you

can

strip

out

other

modes

as

well.

Some information should never be logged using the modes if you don't intend to strip them. For more info, check out https://developer.android.com/reference/android/util/Log

Playstore

Some OpenSRP apps need to be deployed on the Google Playstore. Any such releases should follow the above steps before uploading go Google.

...

Sometimes the process of creating the release which includes shrinkingincludes shrinking, optimization and obfuscation produces unexpected side effects that may be easily caught in the QA process.

Why follow this release process for production APKs?

Unlike the debug variant, the release variant is highly optimized for size and performance. For more information on this and more checkout this link https://developer.android.com/studio/build/shrink-code.html

NB: For releases, OpenSRP is currently in the process of implementing a regular release schedule for the release variants of the libraries to be upload on maven.

If the project has Github Actions CI/CD set up, see:


How to set up Android client CI/CD on Github