当我建立travis-ci时。 它的日志出错了。 这是日志。
* What went wrong:
A problem occurred configuring root project 'Grain'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.3.3.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:2.3.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom'.
> Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused (Connection refused)
这是我的.travis.yml
language: android
jdk:
- oraclejdk8
sudo: true
android:
components:
- tools
- platform-tools
# The BuildTools version used by your project
- build-tools-26.0.0
# The SDK version used to compile your project
- android-26
- extra-android-m2repository
- extra-android-support
在我的项目build.gradle中:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://raw.githubusercontent.com/Pgyer/mvn_repo_pgyer/master" }
}
}
为什么jcenter()重定向到127.0.0.1:8080
,我不知道要解决它。
感谢。
我已经解决了,谢谢。
因为我曾经在gradle.properties
设置了代理,忘记删除它。删除后,这个问题就消失了。