Android Travis CI with Autodeploy (API 26+)
Gerard Rovira

Hi Gerard,

It’s working nicely. Did the following

1. Added this small piece of code to the app’s gradle file:

// Create a variable called keystorePropertiesFile, and initialize it to your
// file, in the rootProject folder.
def keystorePropertiesFile = rootProject.file("")

def keystoreProperties = new Properties()

// Load your file into the keystoreProperties object.
def canSign = false
try {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
canSign = true"Found keystore properties file")
} catch (Exception ex) {
logger.warn("Unable to load keystore properties files. Pay attention you won't be able to compile a release version. $ex.message")

2. Under the android section added:

if (canSign) {
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']


3. Under build types added:

release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), ''
if (canSign) {
signingConfig signingConfigs.release

Under .travis.yml I created file using printf command, e.g.

— printf storePassword=$storePassword\\nkeyPassword=$keyPassword\\nkeyAlias=test\\nstoreFile=${TRAVIS_BUILD_DIR}/android-app.keystore > ${TRAVIS_BUILD_DIR}/

and that’s it. the rest is the same