我有一个与SDK相关的android项目,可在jar文件中找到它,因此我将其放在lib
文件夹中,但是jar
文件中包含gson
库,并且接缝已过期。所以我想排除它,并为gson添加单独的依赖项。
我怎样才能做到这一点?
谢谢
UPD
compile fileTree(include: ['*.jar'], dir: 'libs') {
exclude group: 'com.google.code.gson', module: 'gson'
}
导致错误
Error:(49, 0) Gradle DSL method not found: 'exclude()'
最佳答案
您可以像这样从依赖项中明确排除它:
compile fileTree(dir: 'libs', include: '*.jar', excludes: ['gson-stuff'])
我希望这是有帮助的。
关于gradle - 如何从gradle的jar文件中排除 transient 依赖关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43230876/