更新时间:2021-09-23 21:36:09
你可以在你的测试中强制使用注解库:
You can force the annotation library in your test using:
androidTestCompile 'com.android.support:support-annotations:23.1.0'
像这样:
// Force usage of support annotations in the test app, since it is internally used by the runner module.
androidTestCompile 'com.android.support:support-annotations:23.1.0'
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2.1'
另一种解决方案是在***文件中使用它:
Another solution is to use this in the top level file:
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:23.1.0'
}
与项目“:app"中的依赖项"com.android.support:support-annotations"冲突.应用(26.1.0)和测试应用(27.1.1)的已解决版本不同.
的冲突依赖“com.android.support:support-annotations~~V”。解决版本的应用程序(23.1.0)和测试应用程序(23.0.1)的不同
与依赖项"com.android.support:support-annotations"冲突.应用(23.3.0)和测试应用(23.1.1)的已解决版本不同
与依赖项 'com.android.support:support-annotations' 发生冲突.应用程序 (23.1.0) 和测试应用程序 (23.0.1) 的已解决版本不同