作为中国开发者,你必须要知道有一堵墙,名为GFW。在这时,有时你需要加载网络资源的程序就会莫名奇妙被阻断,这不一定是程序bug,而有可能时网络问题。比如当ionice需要加载资源时无奈正好被肛上了:
What went wrong: A problem occurred configuring root project ‘helloworld’. Could not resolve all dependencies for configuration ‘:classpath’. Could not resolve com.android.tools.build:gradle:1.3.1. Could not resolve com.android.tools.build:gradle:1.3.1. Could not get resource ‘https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom‘. Could not HEAD ‘https://jcenter.bintray.com/com/android/tools/build/gradle/1.3.1/gradle-1.3.1.pom‘. peer not authenticated
这是在我们需要访问jcenter中心加载资源时常见的问题,解决方法如下(此法通用): 将build.grade文件里的jcenter() 用jcenter { url “http://jcenter.bintray.com/“} 替换即可