In the file build.gradle (Module:app)
add the following code:
android {
signingConfigs {
config {
keyAlias KEY_ALIAS
keyPassword KEY_PASSWORD
storeFile file(STORE_FILE)
storePassword STORE_PASSWORD
}
}
....
}
This contains the information for signing the apk. This information is stored in the file grade.properties
:
STORE_FILE=../SEU_AQUIVO_DE_ASSINATURA.keystore
STORE_PASSWORD=SUA SENHA
KEY_ALIAS=SEU ALIAS
KEY_PASSWORD=SUA SENHA DO ALIAS
In this case, we leave SEU_AQUIVO_DE_ASSINATURA
in the project root (next to the app folder).
Now let's say that we will use this signature in build ( signingConfig signingConfigs.config
):
buildTypes {
// Release
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
//Debug
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}