[英]How can i force gradle to use to different versions of a dependency?
I have an Android Studio Project with automated testing using google espresso. 我有一个使用Google espresso进行自动测试的Android Studio项目。 But espresso uses the android support library 23.0.1 and my application the version 23.1.1. 但是espresso使用android支持库23.0.1,而我的应用程序使用版本23.1.1。
Now i want to use the newer version of the library for normal builds and the older one only for test cases. 现在,我想将库的较新版本用于常规构建,而将较旧的仅用于测试用例。
My problem is that gradle forces me to choose one version of the support library. 我的问题是gradle迫使我选择一种版本的支持库。 How can i reconfigure gradle to not abort the build process and ignore the clashing dependencies? 我如何重新配置gradle以不中止构建过程并忽略冲突的依赖关系?
You can use different versions of the support libraries (why?) 您可以使用不同版本的支持库(为什么?)
For example you can use: 例如,您可以使用:
compile 'com.android.support:support-annotations:23.1.1'
androidTestCompile 'com.android.support:support-annotations:23.0.1'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.