I've tried to look for similar questions, but no luck.
I'm building my Gradle project from the command line, and supply the passwords in the gradle release command line using -P.
Here's my build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
}
apply plugin: 'android'
android {
signingConfigs {
release {
storeFile file("C:/Android/Dev/keystore/dm.keystore")
keyAlias KEY_ALIAS
storePassword STORE_PASSWORD
keyPassword KEY_PASSWORD
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
compileSdkVersion 'android-13'
buildToolsVersion '22.0.1'
buildTypes {
release {
minifyEnabled false
proguardFile getDefaultProguardFile('proguard-android.txt')
}
}
}
When I try to do a clean, it gives me:
Could not find property 'KEY_ALIAS' on SigningConfig_Decorated{name=release, storeFile=C:\Android\dev\keystore\dm.keystore, storePassword=null, keyAlias=null, keyPassword=null, storeType=C:\Android\dev\keystore\dm.keystore}.
Someone said that the 'signingConfigs' should come before the 'buildTypes', and it does.
Is there any way that I can keep the 'signingConfigs' in there, but maybe modified somehow, and not have it complain?
If I take 'signingConfigs' out, and add it before I do the release it works.
Thanks!
gradle <build cmd> -PKEY_ALIAS=<alias>
. And do it for all the variables. I would highly suggest to put those in agradle.properties
file. – Jared Burrows