摇篮DSL方法未找到

摇篮DSL方法未找到

本文介绍了摇篮DSL方法未找到:'runProguard“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的最后一个项目的更新后得到一个错误。在我的code不是一个问题,但我在使用build.gradle麻烦。我该如何解决这个问题?

build.gradle code在这里:

 应用插件:'机器人'

安卓{
    compileSdkVersion 21
    buildToolsVersion '20 .0.0

    packagingOptions {
        不包括META-INF / DEPENDENCIES
        不包括META-INF /许可证
        不包括META-INF / LICENSE.TXT
        不包括META-INF / LICENSE.TXT
        不包括META-INF /注意事项
        不包括META-INF / NOTICE.txt
        不包括META-INF / notice.txt
        不包括META-INF / ASL2.0
    }

    defaultConfig {
        的applicationIDcom.xxx.axxx
        的minSdkVersion 14
        targetSdkVersion 19
        版本code 6
        VERSIONNAME'1.0'
    }
    buildTypes {
        推出 {
            runProguard假
            proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
        }
    }
    productFlavors {
    }
}

依赖{
    编译文件树(导演:库,包括:['的* .jar'])
    编译com.android.support:appcompat-v7:19.+
    编译文件(库/ commons- codeC-1.8.jar)
    编译文件(库/ asmack,Android的8-4.0.4.jar)
    编译com.android.support:support-v4:21.0.0
    编译com.google code.gson:GSON:2.2.4
    编译com.jakewharton:butterknife:5.1.1
}
 

摇篮同步消息输出:

 错误:(27,0)未找到摇篮DSL的方法:runProguard()
**可能的原因:
项目'Atomic4Mobile'可使用一个版本的摇篮不包含的方法。
**摇篮设置**
构建文件可能丢失一个摇篮插件。
**应用摇篮插件**
 

解决方案

如果您使用的是0.14.0版本或摇篮插件较高,则应更换的runProguardminifyEnabled的在你的build.gradle文件。

runProguard 的被重命名为 minifyEnabled 的在0.14.0版本。欲了解更多信息,请见的Andr​​oid构建系统

I get an error after updating from my last project. Not a problem in my code but I'm having trouble with build.gradle. How can I fix it?

build.gradle code here:

apply plugin: 'android'

android {
    compileSdkVersion 21
    buildToolsVersion '20.0.0'

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }

    defaultConfig {
        applicationId 'com.xxx.axxx'
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 6
        versionName '1.0'
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
    compile files('libs/commons-codec-1.8.jar')
    compile files('libs/asmack-android-8-4.0.4.jar')
    compile 'com.android.support:support-v4:21.0.0'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.jakewharton:butterknife:5.1.1'
}

Gradle Sync message output:

Error:(27, 0) Gradle DSL method not found: 'runProguard()'
**Possible causes:
The project 'Atomic4Mobile' may be using a version of Gradle that does not contain the method.
**Gradle settings**
The build file may be missing a Gradle plugin.
**Apply Gradle plugin**
解决方案

If you are using version 0.14.0 or higher of the gradle plugin, you should replace "runProguard" with "minifyEnabled" in your build.gradle files.

runProguard was renamed to minifyEnabled in version 0.14.0. For more info, See Android Build System

这篇关于摇篮DSL方法未找到:'runProguard“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 20:35