3

我刚刚将我的 Android 工作室从 1.0 RC 2 升级到 1.0.1。

之后,系统提示我将 gradle 插件从 0.14.0 更新到 1.0.0。

一旦我这样做了, gradle build 就会因错误而失败 -

Error:No such property: GRADLE_SUPPORTED_VERSIONS for class: com.saikoa.dexguard.h

有没有其他人遇到过类似的问题?万分感谢 !

我的 build.gradle -

buildscript {
repositories {
    flatDir { dirs '../lib' } // For the DexGuard plugin.
    mavenCentral()               // For the Android plugin.

}
dependencies {
    classpath ':dexguard:'
    classpath 'com.android.tools.build:gradle:1.0.0'
}
}

apply plugin: 'dexguard'
android {
buildTypes {
    release {
        proguardFiles getDefaultDexGuardFile('dexguard-release.pro'),'dexguard-project.txt'
    }
    debug{
        //proguardFiles getDefaultDexGuardFile('dexguard-release.pro'),'dexguard-project.txt'
        proguardFiles getDefaultDexGuardFile('dexguard-debug.pro'),'dexguard-project.txt'
    }
}
}
4

1 回答 1

5

对于 Android 插件 1.0.+,您应该确保您使用的是 DexGuard 插件 6.1.+。

然后,您需要应用这两个插件:

apply plugin: 'com.android.application'
apply plugin: 'dexguard'

最后,Android 插件 1.0.0 需要 Gradle 2.2.1。

于 2014-12-15T23:01:53.277 回答