前几天跟着教程学RecyclerView 的时候,android studio 的build.gradle死活不能将com.squareup.picasso:picasso:2.5.2 编译过,一直报错,网上找来的方法大多是说加上
代码:
repositories {
jcenter()
mavenCentral()
}
clean project后仍没有效果,然后在多次尝试中突然它爆出错误说:
Could not resolve all dependencies for configuration ':app:_debug Could not resolve com.squareup.picasso:picasso:2.5.2. Required by: floatbutton:app:unspecified > No cached version of com.squareup.picasso:picasso:2.5.2 available for offline mode. > No cached version of com.squareup.picasso:picasso:2.5.2 available for offline mode. > No cached version of com.squareup.picasso:picasso:2.5.2 available for offline mode.
咦,然后我就把 File->Settings->Build,Execution,Deployment->Gradle 右边的Offline work的勾取消掉了,Clean 了一下项目,并且设置了 repositories
然后出现了:`Error:A problem occurred configuring project ‘:app’.
Could not resolve all dependencies for configuration ‘:app:_debugCompile’.
Could not resolve com.mcxiaoke.volley:library:1.0.18.
Required by:
udacity-android-nanodegree–july2015-project1:app:unspecified
Could not GET ‘https://jcenter.bintray.com/com/mcxiaoke/volley/library/1.0.18/library-1.0.18.pom‘.
Connection to https://jcenter.bintray.com refused
Could not GET ‘https://repo1.maven.org/maven2/com/mcxiaoke/volley/library/1.0.18/library-1.0.18.pom‘.
Connection to https://repo1.maven.org refused
额。。。。猜测大概是https:的锅,然后改为
repositories {
maven {
url "http://repo1.maven.org/maven2"
}
}
万岁,成功了
写这么多是因为,在查到的资料里,这里提到的每一步都有人成功解决这个问题,我的方法肯定不是最好的。但我直到最后一步才解决,所以我都记录下来了
相关链接:AndroidStudio创造TV-APP,出现Error:(28, 13) Failed to resolve: com.squareup.picasso:picasso:2.5.0 的解决,这位博主用了另一种方法解决