编译项目(:somelibrary)时出现了"exclude not found?"的错误提示?这是因为"exclude"函数未找到。

6

我在Android Studio中导入了一个项目库,但无法排除一组,因为当compile指令在包含的项目上时,gradle无法找到该排除方法。

对于以下方法,它可以找到exclude:

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

但不适用于以下内容:
   compile project(:somelibrary) { exclude group: 'com.google.guava' }

这个排除方法对于已包含的项目不可用?怎么回事?我该如何排除这个组?
1个回答

24

尝试:

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

注意多余的括号。在你的情况下,闭包与compile不同,而是与project相关联。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接