我想构建 android 应用程序并开始对其进行签名。为此,我需要发布版本的 apk。Google 文档仅建议使用 Eclipse 和 ant 方式进行发布构建:http: //developer.android.com/tools/publishing/app-signing.html#releasecompile
但是我找不到如何强制 gradle build release 版本的 apk。build.gradle
也没有给出任何提示。gradlew tasks
建议,没有安装发布配置,但卸载发布存在:
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
我的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
}
}
我错过了什么?