Gradle错误:构建命令行时对等体未经过身份验证

时间:2016-10-10 20:24:08

标签: android qt gradle

我有一个QtApp,我正在使用gradle为android构建。请注意,我正在使用工具androiddeployqt使用以下命令在 OSX 上构建命令行

$androiddeployqt --sign MyKey.keystore gevupc --storepass somePassword --output android --verbose --input android-libMyQtApp.so-deployment-settings.json

使用gradle解决代理问题后,它现在给我以下错误

Unzipping /var/lib/jenkins/gradlesettings/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/gradle-2.2.1-all.zip to /var/lib/jenkins/gradlesettings/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b
Set executable permissions for: /var/lib/jenkins/gradlesettings/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/gradle-2.2.1/bin/gradle

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android-build'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:1.1.0.
     Required by:
         :android-build:unspecified
      > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.1.0/gradle-1.1.0.pom'.
     > peer not authenticated

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

有人可以建议如何摆脱这个问题吗?

2 个答案:

答案 0 :(得分:0)

如果您的互联网连接出现问题,通常会发生这种情况。

确保您已正确配置代理并检查您的互联网连接。直接到它提到的地址,看你是否可以通过浏览器访问它。

答案 1 :(得分:0)

问题在于buildscript块中列出的存储库。使用以下块可以直接解决问题。

apply plugin: 'com.android.application'
apply plugin: 'maven'
buildscript {
    repositories {
        maven  {
            url "http://repo1.maven.org/maven2"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
    }
}

url "http://repo1.maven.org/maven2"是gradle 2.1.3能够解析的存储库依赖项。