我尝试使用最新的andruid studio构建一个andruid应用程序 似乎由于本地计算机certstore中缺少jcenter证书而导致gradle被阻止。我的同事成功地在他的机器上构建它,所以问题在于配置而不是应用程序代码
配置:andruid studio 3.0.1,gradle 3.0.0 ?, windows 7
我还试图通过用
替换build.gradle中的jcenter()来解决ssl握手问题 maven {
url "http://jcenter.bintray.com"
}
但它没有解决问题
我的build.gradle如下:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Gradle控制台:
Executing tasks: [assemble]
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'PDA'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.0.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.0.0.
> Could not get resource 'http://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Could not HEAD 'http://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Connect to repo.jfrog.org:80 [repo.jfrog.org/52.72.224.151, repo.jfrog.org/34.204.33.255] failed: Connection timed out: connect
答案 0 :(得分:0)
插件v。 3.x.x
classpath 'com.android.tools.build:gradle:3.0.0'
jcenter
中的不是 你必须使用谷歌maven回购。
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
如果您使用的是Android Studio 3和gradle v.4.x,则可以使用google()
快捷方式
buildscript {
repositories {
...
google()
}
}
答案 1 :(得分:0)
除了@GabrieleMariotti alreay说,在JCenter中找不到该库,你不应该得到Connection timed out: connect
,而是要找到没有找到该库的消息。
let roadSprite = SKSpriteNode(imageNamed: roadImage)
...
let addRoad = SKAction.run {self.addChild(roadSprite)} //capture the local variable in your closure here
提示,您无法从计算机访问该网址。我最好的猜测是你必须使用一些代理才能访问为你的同事正确配置的URL,但不适合你。