我最近将一个eclipse项目迁移到了androidStudio。但是在构建 AS 时未能解决依赖关系。起初我认为这可能是代理问题,因为我在受限网络中,所以我添加了代理设置没有结果。 所以我在终端中尝试了 gradlew,输出如下:
Could not resolve all dependencies for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:2.3.2. Required by: project : Could not resolve com.android.tools.build:gradle:2.3.2. Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom'. Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom'. This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server
所以我尝试从我的浏览器访问“https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.2/gradle-2.3.2.pom”,它成功地下载了文件。这意味着网络正常。
那么为什么 AS studio 无法解决依赖关系? gradle版本有问题吗? 我如何决定哪个 gradle 版本适合我的项目?
感谢您的回复。
最佳答案
尝试:
首先:
repositories {
jcenter({url "http://jcenter.bintray.com/"})
}
如果不行,Gradle手动同步代理
gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8580
关于安卓工作室 : Gradle failed to resolve Dependencies,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44063539/