无法解析org.jetbrains:注释:{严格为13.0}

时间:2019-08-15 16:03:15

标签: android android-espresso androidx

当我在Android项目中使用

    androidTestImplementation "androidx.test.ext:junit:1.1.1"
    androidTestImplementation 'androidx.test:runner:1.2.0'

为减少弃用警告,我遇到了

> Could not resolve all files for configuration ':sample:debugAndroidTestRuntimeClasspath'.
   > Could not resolve org.jetbrains:annotations:{strictly 13.0}.
     Required by:
         project :sample
      > Cannot find a version of 'org.jetbrains:annotations' that satisfies the version constraints: 
           Dependency path 'Moka:sample:unspecified' --> 'Moka:moka:unspecified' --> 'com.jakewharton.timber:timber:4.7.1' --> 'org.jetbrains:annotations:16.0.1'
           Constraint path 'Moka:sample:unspecified' --> 'org.jetbrains:annotations:{strictly 13.0}' because of the following reason: debugRuntimeClasspath uses version 13.0
           Dependency path 'Moka:sample:unspecified' --> 'org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.41' --> 'org.jetbrains.kotlin:kotlin-stdlib:1.3.41' --> 'org.jetbrains:annotations:13.0' 

1 个答案:

答案 0 :(得分:0)

我能够用

解决它
android {
    ...

    configurations.all {
        resolutionStrategy {
            // Please removed it, as soon as the project compiles without it
            force 'org.jetbrains:annotations:13.0'
        }
    }
}