Reputation: 12915
There are a few questions related to my question in Stackoverflow, such as:
How do I export a project in the Android studio?
How to create a release signed apk file using Gradle
They're good. But Still make me confused. When I selected Build->Generate signed APK in Android Studio, I got this warning message:
What does this mean? Does it mean I have to use gradle command line by config the build.gradle? Then what is the wizard for? If I just ignore the warning by click ok and follow the wizard to generate the apk file, I'll get error message saying the apk is in debug mode when I upload the apk to Google Play.
If I follow the instruction to setup the build.gradle like this:
signingConfigs {
debug {
storeFile file("debug.keystore")
}
release {
storeFile file("../key/test.keystore")
storePassword "password"
keyAlias "key"
keyPassword "password"
}
}
buildTypes {
release {
debuggable false
signingConfig signingConfigs.release
}
}
And everything is file when I run ./gradlew assembleRelease in terminal.
In summary, I'm confused at:
Thank you for any suggestion.
Upvotes: 11
Views: 18234
Reputation: 12915
In left bottom corner of Android Studio, select the Build Variances, then you can change the build mode to "release". When building in release mode, I think the "Generate Signed APK" wizard works. So just ignore the build.gradle configuration!
Upvotes: 17