Your release build type is not configured for signing.
If you are signing your apk manually, you need to run ZipAlign manually as well. ZipAlign must happen after signing.
Gradle will zipalign an apk only if it can sign as well.
To setup signing for the release config, you'll need to first create a new signing config, then assign it to the build type.
android {
signingConfigs {
release {
storeFile file("/path/to/keystore")
storePassword "??"
keyAlias "??"
keyPassword "??"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
Note that all 4 parameters in the signing config are required, otherwise it'll consider some values are missing and it won't even attempt to sign.