0
votes

I have this dependency which works fine in my build.gradle file:

androidTestImplementation ('com.android.support.test.espresso:espresso-contrib:2.0') {
    exclude group: 'com.android.support', module: 'support-v4'
}

But when I do the same thing in my versions.gradle:

def support = [:]
    support.appcompat = "com.android.support:appcompat-v7:$versions.support"
        def test = [:]
            test.contrib = "com.android.support.test.espresso:espresso-contrib:$versions.contrib"{
                exclude group: 'com.android.support', module: 'support-v4'
            }
        support.test = test
deps.support = support

I get this error:

ERROR: Could not find method com.android.support.test.espresso:espresso-contrib:2.0()

How to exclude that group in my versions file? Thanks!

First time i see a file versions.gradle. can you tell what is the purpose of this file and how it is used by gradle/android build system? - Ranjan Kumar
It is used help me not use more simple dependency definition. - Lilian Sorlanski