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'
換成之前不報(bào)錯(cuò)的版本襟企,例如我之前不報(bào)錯(cuò)的版本為
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
同步一下就可以了