[英]Espresso Error:Conflict with dependency 'com.android.support:support-v4'. Resolved versions for app (24.2.0) and test app (23.1.1) differ
I have upgraded to the latest API level 24 which is the latest API Level (at time of writhing) anyhow it caused this error message. 我已经升级到最新的API级别24,这是最新的API级别(在发生问题时),无论如何它都会导致此错误消息。
Error:Conflict with dependency 'com.android.support:support-v4'.
错误:与依赖项“ com.android.support:support-v4”冲突。 Resolved versions for app (24.2.0) and test app (23.1.1) differ.
应用(24.2.0)和测试应用(23.1.1)的已解决版本不同。 See http://g.co/androidstudio/app-test-app-conflict for details.
有关详情,请参见http://g.co/androidstudio/app-test-app-conflict 。
So How can I fix this? 那么我该如何解决呢?
Also this page the 2nd answer down gives a solution to the problem but if you want to include com.android.support.test.espresso:espresso-contrib:2.2.2
in your then this will lead to 4 more similar error messages. 同样, 此页面的第二答案给出了解决该问题的方法,但是如果您要在您的计算机中包含
com.android.support.test.espresso:espresso-contrib:2.2.2
,那么这将导致出现4条类似的错误消息。
So How can I get rid of these 4 extra error messages? 那么,如何摆脱这4条额外的错误消息呢?
Here are my Espresso build.gradle dependencies: 这是我的Espresso build.gradle依赖项:
androidTestCompile "com.android.support:support-annotations:$SUPPORT_VERSION"
androidTestCompile "com.android.support.test.espresso:espresso-core:$ESPRESSO_VERSION"
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile "com.android.support.test.espresso:espresso-intents:$ESPRESSO_VERSION"
/**
* AccessibilityChecks
* CountingIdlingResource
* DrawerActions
* DrawerMatchers
* PickerActions (Time and Date picker)
* RecyclerViewActions
*/
androidTestCompile("com.android.support.test.espresso:espresso-contrib:$ESPRESSO_VERSION") {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-v7'
exclude group: 'com.android.support', module: 'design'
exclude module: 'support-annotations'
exclude module: 'recyclerview-v7'
}
where: 哪里:
ESPRESSO_VERSION = '2.2.2'
Check my project's build.gradle
file if you still stuck: https://github.com/piotrek1543/LocalWeather/blob/master/app/build.gradle 如果仍然卡住,请检查我项目的
build.gradle
文件: https : //github.com/piotrek1543/LocalWeather/blob/master/app/build.gradle
Hope it will help 希望对你有帮助
I found a solution (workaround) If you click on the picture below you will note look at the picture below you will note that the error message 我找到了解决方法(解决方法),如果您单击下面的图片,您将注意到下面的图片,您将注意到错误消息
Error:Conflict with dependency 'com.android.support:support-v4'.
错误:与依赖项“ com.android.support:support-v4”冲突。 Resolved versions for app (24.2.0) and test app (23.1.1) differ.
应用(24.2.0)和测试应用(23.1.1)的已解决版本不同。 See http://g.co/androidstudio/app-test-app-conflict for details.
有关详情,请参见http://g.co/androidstudio/app-test-app-conflict 。
will be fixed with the line 用线固定
configurations.all {resolutionStrategy.force "com.android.support:support-v4:23.1.0"}
Which is located in the dependencies area of the gradle file 它位于gradle文件的依赖项区域中
Likewise the error message 同样的错误信息
Error:Conflict with dependency 'com.android.support:appcompat-v7'.
错误:与依赖项“ com.android.support:appcompat-v7”冲突。 Resolved versions for app (24.2.0) and test app (23.1.0) differ.
应用(24.2.0)和测试应用(23.1.0)的已解决版本不同。 See http://g.co/androidstudio/app-test-app-conflict for details.
有关详情,请参见http://g.co/androidstudio/app-test-app-conflict 。
can be fixed with the line 可以用线固定
configurations.all {resolutionStrategy.force "com.android.support:appcompat-v7:23.1.0"}
And so on and so fourth until all the errors are solved ps Don't forget to go here for the main solution (2nd and 3rd answer down configurations.all {resolutionStrategy.force "com.android.support:appcompat-v7:23.1.0"}
类推,直到解决所有错误为止ps不要忘了在这里找到主要解决方案(第二和第三答案向下
您可以使用以下命令在测试中强制使用支持库:
androidTestCompile 'com.android.support:support-v4:24.2.0'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.