我注意到gradle assembleRelease
在过时的 ProGuard 版本上运行调用,从 shell 输出中可以看出:
$ gradle assembleRelease
Relying on packaging to define the extension of the main artifact has been \
deprecated and is scheduled to be removed in Gradle 2.0
:Foobar:preBuild UP-TO-DATE
:Foobar:preReleaseBuild UP-TO-DATE
:Foobar:preDebugBuild UP-TO-DATE
:Foobar:prepareComAndroidSupportAppcompatV71900Library UP-TO-DATE
:Foobar:prepareComGoogleAndroidGmsPlayServices3136Library UP-TO-DATE
:Foobar:prepareReleaseDependencies
:Foobar:compileReleaseAidl UP-TO-DATE
:Foobar:compileReleaseRenderscript UP-TO-DATE
:Foobar:generateReleaseBuildConfig UP-TO-DATE
:Foobar:mergeReleaseAssets UP-TO-DATE
:Foobar:mergeReleaseResources UP-TO-DATE
:Foobar:processReleaseManifest UP-TO-DATE
:Foobar:processReleaseResources UP-TO-DATE
:Foobar:generateReleaseSources UP-TO-DATE
:Foobar:compileRelease UP-TO-DATE
:Foobar:proguardRelease
ProGuard, version 4.9
The output seems up to date
:Foobar:dexRelease UP-TO-DATE
:Foobar:processReleaseJavaRes UP-TO-DATE
:Foobar:packageRelease UP-TO-DATE
:Foobar:assembleRelease UP-TO-DATE
BUILD SUCCESSFUL
Total time: 15.703 secs
我在我的使用以下配置build.gradle
:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
}
buildTypes {
release {
runProguard true
proguardFile 'proguard-project.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:19.0.0'
compile 'com.android.support:support-v4:19.0.0'
compile 'com.google.android.gms:play-services:3.1.36'
}
如何将 gradle 指向可能从PATH
例如/usr/local/bin/proguard
?
另一种解决方案是引用所需的版本,如下所示:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
classpath 'net.sf.proguard:proguard-gradle:4.10'
}
}
...
你的设置是什么?