Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 721
Stacking Avatar asked Mar 17 '16 12:03

Stacking


1 Answers

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.

like image 56
cjstehno Avatar answered Nov 15 '22 08:11

cjstehno