美文网首页
Android dependency 'com.android.

Android dependency 'com.android.

作者: bby08 | 来源:发表于2018-04-28 10:25 被阅读0次

Error:Execution failed for task ':app:preDebugBuild'.

Android dependency 'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution

图片
解决

方法一:
在app的build.gradle中的dependencies里添加:

configurations.all {
    resolutionStrategy.force 'com.android.support:support-annotations:26.1.0'
}

方法二:
将app的build.gradle中的dependencies里的

    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

换成之前不报错的版本,例如我之前不报错的版本为

    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

同步一下就可以了

相关文章

网友评论

      本文标题:Android dependency 'com.android.

      本文链接:https://www.haomeiwen.com/subject/gveilftx.html