gpt4 book ai didi

android - Gradle 和 proguard : could not find method runProguard() for arguments [true]

转载 作者:IT老高 更新时间:2023-10-28 23:26:27 26 4
gpt4 key购买 nike

我已经按照 Proguard Gradle manual 的建议配置了 build.gradle

这是根 build.gradle

buildscript {
repositories {
flatDir dirs: '/home/username/android-sdks/tools/proguard/lib'
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
classpath ':proguard'
}
}

现在这是我项目的 build.gradle

apply plugin: 'android'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':SomeLibraryProject')
}

android {
compileSdkVersion 19
buildToolsVersion "19.0.0"

sourceSets {
...
}

task runProguardTask(type: proguard.gradle.ProGuardTask) {
}

signingConfigs {
debug {
storeFile file("./keystore/keystore")
storePassword "******"
keyAlias "******"
keyPassword "*******"
}

release {
runProguard true
proguardFile 'proguard-android.txt'
storeFile file("./releasekey/keystore")
storePassword "******"
keyAlias "********"
keyPassword "*******"
}
}

buildTypes {
release {
signingConfig signingConfigs.release
}
}
}

这是输出

$ ./gradlew build

FAILURE: Build failed with an exception.

* Where:
Build file '/home/username/Documents/eclipse/workspace/repo/ProjectName/build.gradle' line: 49

* What went wrong:
A problem occurred evaluating project ':ProjectName'.
> Could not find method runProguard() for arguments [true] on SigningConfigDsl_Decorated{name=release, storeFile=null, storePassword=null, keyAlias=null, keyPassword=null, storeType=null}.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 9.14 secs

我也想知道为什么storeFile、storePassword、keyAlias和keyPassword都是空的?

最佳答案

runProguard 已弃用(很快就会停止工作);改为“minifyEnabled

...

buildTypes {
release {
minifyEnabled true
....

关于android - Gradle 和 proguard : could not find method runProguard() for arguments [true],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20115391/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com