Unsupported Gradle DSL method found: 'exclude()'

Solution 1:

Use

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

So with extra parentheses.