Reputation: 15116
When I tried to upgrade mockito for my Android project, from 2.8.47 to 2.13.3, I got an error:
Error:Failed to resolve: org.mockito:mockito-core:2.13.3
All my gradle configurations are correct, worked perfectly with 2.8.47 (below I just replace the mockito version with the latest one).
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://maven.google.com"
}
}
}
ext {
mockitoVersion = "2.13.3"
}
dependencies {
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
}
And when doing gradle sync, you can see at the bottom of Android Studio, there are some logs:
Gradle: Download https://maven.google.com/org/mockito/mockito-core/2.13.3/mockito-core-2.13.3.pom
Upvotes: 2
Views: 13604
Reputation: 15116
Actually mockito is not hosted on maven.google.com.
The issue is due to two facts:
Solution:
Change the dependency version to 2.13.0 instead of 2.13.3, then it works fine.
Lessons Learnt:
Always check with mvnrepository, don't trust the release page of the project.
Upvotes: 14