Stacking
Stacking

Reputation: 83

compile project(:somelibrary) { exclude group: 'com.google.guava' } function exclude not found?

I imported project a library in Android Studio, but am not able to exclude a group because gradle does not find that exclude method method when the compile directive is on an included project?

It can find exclude for the following method

      compile('xyc.com.whatever'){exclude 'com.google.guava'}

but not for:

   compile project(:somelibrary) { exclude group: 'com.google.guava' }

this exclude method is not available for included project? what gives? How can I exclude this group?

Upvotes: 6

Views: 3237

Answers (1)

cjstehno
cjstehno

Reputation: 13984

Try:

compile( project(:somelibrary) ){
    exclude group:'com.google.guava'
}

Notice the extra parens. In your case, the closure is associated with project rather than compile.

Upvotes: 24

Related Questions