1. 将某library作为一个module导入集成时,报错
    Error:Execution failed for task ‘:app:preDebugAndroidTestBuild’.

Conflict with dependency ‘com.android.support:support-annotations’ in project ‘:app’. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versi

问题分析:由于com.android.support:support-annotations的版本不一致导致,可强制使用某一版本。
解决方案:
在您工程的app的build.gradle中的dependences {}中添加

androidTestCompile(‘com.android.support:support-annotations:26.1.0’) {
force = true
}

添加后dependences中结构类似:
Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versi

相关文章:

  • 2021-05-23
  • 2022-01-14
  • 2021-11-22
  • 2021-06-15
  • 2022-01-16
  • 2022-12-23
  • 2021-12-20
猜你喜欢
  • 2021-07-30
  • 2021-12-10
  • 2021-12-09
  • 2022-12-23
  • 2021-04-27
  • 2022-12-23
相关资源
相似解决方案