Tôi muốn xây dựng ứng dụng android và bắt đầu ký nó. Đối với điều đó, tôi cần có phiên bản phát hành của apk. Tài liệu của Google chỉ đề xuất Eclipse và các cách ant để có các bản phát hành: http://developer.android.com/tools/publishing/app-signs.html#releasecompile
Tuy nhiên, tôi không thể tìm thấy cách bắt buộc phiên bản phát hành phiên bản nâng cấp của apk. build.gradlecũng không đưa ra bất kỳ gợi ý nào. gradlew tasksgợi ý rằng không có cấu hình Bản phát hành cài đặt, nhưng bản phát hành gỡ cài đặt tồn tại:
Install tasks
-------------
installDebug - Installs the Debug build
installTest - Installs the Test build for the Debug build
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build
uninstallRelease - Uninstalls the Release build
uninstallTest - Uninstalls the Test build for the Debug build
Của tôi build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile files('libs/android-support-v4.jar')
compile project(":libraries:ActionBarSherlock")
compile project(":libraries:CollabsibleSearchMenu")
}
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
defaultConfig {
minSdkVersion 8
targetSdkVersion 16
}
}
Những gì tôi đang thiếu?


Hình 4. Tạo cấu hình ký trong Android Studio.
Hình 5. Chọn cấu hình ký trong Android Studio.



Build->Generate Signed APKtừ menu.