Could not resolve org.jetbrains:annotations:{strictly 13.0}

与世无争的帅哥 提交于 2019-12-11 19:05:25

问题


When I use in my Android project

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

to reduce deprecation warnings, I run into

> 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:


I was able to solve it with

android {
    ...

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


来源:https://stackoverflow.com/questions/57512625/could-not-resolve-org-jetbrainsannotationsstrictly-13-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!