【问题标题】:Unsupported Gradle DSL method found: 'exclude()'发现不支持的 Gradle DSL 方法:“exclude()”
【发布时间】:2014-04-19 16:21:51
【问题描述】:

如果:

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
    }
}

我收到此错误消息:

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

但这有效:

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'
}

试图了解原因,请澄清!

【问题讨论】:

    标签: android gradle


    【解决方案1】:

    使用

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

    所以加上额外的括号。

    【讨论】:

    • 几个小时的几个括号...谢谢!
    • 我非常感谢你的提示!
    猜你喜欢
    • 1970-01-01
    • 2014-09-03
    • 2014-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-18
    相关资源
    最近更新 更多