如何解决Android应用程序与测试apk版本冲突?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (1)
  • 关注 (0)
  • 查看 (253)

Androidstudio 3.0.1:创建新项目时报错: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.

   com.android.support.test:runner:1.0.2
        \ com.android.support:support-annotations:27.1.1

   com.android.support:appcompat-v7:26.1.0'
        \ com.android.support:support-annotations:26.1.0
提问于
用户回答回答于

只需排除annotation

androidTestImplementation('com.android.support.test.espresso:espresso- core:3.0.2') {
        exclude group: 'com.android.support', module: 'support-annotations'
   }

扫码关注云+社区

领取腾讯云代金券