Resolved versions for app (26.1.0) and test app (27.1.1) differ的四种解决办法

第一种:Rebuild Project

但是每次打开程序都要Rebuild Project一次。

第二种:注释

//    testImplementation 'junit:junit:4.12'
//    androidTestImplementation 'com.android.support.test:runner:1.0.2'
//    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

第三种:把版本号26改成27,把v7:26.1.0改成v7:27.1.1。

compileSdkVersion 27
targetSdkVersion 27
implementation 'com.android.support:appcompat-v7:27.1.1'

第四种:在app下的build.gradle文件中的dependences中添加如下代码:

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

猜你喜欢

转载自blog.csdn.net/weixin_37011894/article/details/82218351