本文介绍了同一个库的多个版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个项目A,过去有模块A1,它使用了dagger v。1.2.2。 现在我想添加到依赖于匕首v.2.0的项目A,模块A2。 但我不能因为这两个匕首库存有冲突。我可以在不同的android模块中以某种方式获得多个版本的库吗? 配置{ all * .exclude group:'com.google.android',模块:'support-v4'} 依赖关系{ compile'com .android.support:support-v4:13.0.0'} 来自: https://github.com/stepneneuros/robospice/issues/161 OR 依赖关系{ compile( org.gradle.test.excludes:api:1.0){ exclude module:'shared'} } 发件人: https:// docs.gradle.org/current/userguide/dependency_management.html #52.4.7 I have project A, which used to have module A1, that used dagger v. 1.2.2.Now I'd like to add to project A, module A2, that has dependency on dagger v. 2.0.But I can't because these two dagger libs are in conflict. Can I approach somehow multiple versions of library in different android modules? 解决方案 You can't have both.You need to exclude the conflicting libraries from dependencies:configurations { all*.exclude group: 'com.google.android', module: 'support-v4'}dependencies { compile 'com.android.support:support-v4:13.0.0'}From: https://github.com/stephanenicolas/robospice/issues/161ORdependencies { compile("org.gradle.test.excludes:api:1.0") { exclude module: 'shared' }}From: https://docs.gradle.org/current/userguide/dependency_management.html #52.4.7 这篇关于同一个库的多个版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!