不支持的摇篮DSL方法发现:“排除() [英] Unsupported Gradle DSL method found: 'exclude()'

查看:124
本文介绍了不支持的摇篮DSL方法发现:“排除()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果:

 相关性{
    编译com.google code.gson:GSON:2.2.4
    编译de.keyboardsurfer.android.widget:crouton:1.8.3
    编译de.greenrobot:eventbus:2.2.0
    编译com.intellij:注释:+ @罐子
    编译com.jpardogo.googleprogressbar:图书馆:1.0.0

    编制项目(:floatlabel)
    编制项目(:Android的SwipeToDismiss)
    编制项目(:Android的UndoBar'){
        排除组:com.nineoldandroids',模块:'库'//没有或没有这一项
    }
    编制项目(:AndroidSlidingUpPanel:库'){
        排除组:com.nineoldandroids',模块:'库'//没有或没有这一项
    }
}
 

我收到此错误信息:

 摇篮mProject项目刷新失败:构建脚本错误,不支持的摇篮DSL方法发现:排除()'!
 

不过,这部作品:

 相关性{
    编译com.google code.gson:GSON:2.2.4
    编译de.keyboardsurfer.android.widget:crouton:1.8.3
    编译de.greenrobot:eventbus:2.2.0
    编译com.intellij:注释:+ @罐子
    编译com.jpardogo.googleprogressbar:图书馆:1.0.0

    编制项目(:floatlabel)
    编制项目(:Android的SwipeToDismiss)
    编制项目(:Android的UndoBar)
    编制项目(:AndroidSlidingUpPanel:库)
}

配置{
    所有* .exclude组:com.nineoldandroids',模块:图书馆
}
 

试图了解为什么,请说明!

解决方案

使用

 编译(项目(:Android的UndoBar')){
        排除组:com.nineoldandroids',模块:'库'//没有或没有这一项
    }
 

因此​​,与额外的括号。

If:

dependencies {
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'de.keyboardsurfer.android.widget:crouton:1.8.3'
    compile 'de.greenrobot:eventbus:2.2.0'
    compile 'com.intellij:annotations:+@jar'
    compile 'com.jpardogo.googleprogressbar:library:1.0.0'

    compile project(':floatlabel')
    compile project(':Android-SwipeToDismiss')
    compile project(':Android-UndoBar') {
        exclude group: 'com.nineoldandroids', module: 'library' // without or without this one
    }
    compile project(':AndroidSlidingUpPanel:library') {
        exclude group: 'com.nineoldandroids', module: 'library' // without or without this one
    }
}

I receive this error message:

Gradle 'mProject' project refresh failed: Build script error, unsupported Gradle DSL method found: 'exclude()'!

But this works:

dependencies {
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'de.keyboardsurfer.android.widget:crouton:1.8.3'
    compile 'de.greenrobot:eventbus:2.2.0'
    compile 'com.intellij:annotations:+@jar'
    compile 'com.jpardogo.googleprogressbar:library:1.0.0'

    compile project(':floatlabel')
    compile project(':Android-SwipeToDismiss')
    compile project(':Android-UndoBar')
    compile project(':AndroidSlidingUpPanel:library')
}

configurations {
    all*.exclude group: 'com.nineoldandroids', module: 'library'
}

Trying to understand why, please clarify!

解决方案

Use

compile (project(':Android-UndoBar')) {
        exclude group: 'com.nineoldandroids', module: 'library' // without or without this one
    }

So with extra parentheses.

这篇关于不支持的摇篮DSL方法发现:“排除()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆