未通过身份验证:在Android Studio中构建应用时出错 [英] peer not authenticated: Error while building app in Android Studio

查看:196
本文介绍了未通过身份验证:在Android Studio中构建应用时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试构建使用fabric.io中的crashlytics的应用程序。
但是由于下面提到的错误,构建失败。

 执行任务:[clean,:app:generateDebugSources,:app:generateDebugAndroidTestSources] 

需求是一项孵化功能。

失败:构建失败,出现异常。

*出错:
配置项目':app'时发生问题。
>无法解析配置':app:classpath'的所有依赖关系。
>无法解析io.fabric.tools:gradle:1.+。
要求:
TestProject18July2016:app:unspecified
>无法解析io.fabric.tools:gradle:1.+。
>无法列出io.fabric.tools:gradle的版本。
>无法从https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml加载Maven元数据。
>无法GET'https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml'。
> peer未经过验证

*尝试:
使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。

建立失败

总时间:1.367秒

我的互联网在代理服务器后面。我已经启用了HTTP& gradle.properties文件中的HTTPS设置。

  ##项目范围的Gradle设置。 

#有关如何配置构建环境的更多详细信息,请访问
#http://www.gradle.org/docs/current/userguide/build_environment.html

#指定用于守护进程的JVM参数。
#该设置对调整内存设置特别有用。
#默认值:-Xmx10248m -XX:MaxPermSize = 256m
#org.gradle.jvmargs = -Xmx2048m -XX:MaxPermSize = 512m -XX:+ HeapDumpOnOutOfMemoryError -Dfile.encoding = UTF-8

#配置后,Gradle将以孵化并行模式运行。
#此选项只能用于解耦项目。更多详情,请访问
#http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
#org.gradle.parallel = true
#Mon Jul 18 11:14:57 IST 2016
systemProp.http.proxyPassword =< PASSWORD>
systemProp.https.proxyUser =< USERID>
systemProp.https.proxyPort =< PORT>
systemProp.http.proxyHost =< PROXY_SERVER_ADDRESS>
systemProp.https.proxyPassword =< PASSWORD>
systemProp.https.proxyHost =< PROXY_SERVER_ADDRESS>
systemProp.http.proxyUser =< USERID>
systemProp.http.proxyPort =< PORT>

我的build.gradle文件如下:

  //顶层构建文件,您可以在其中添加对所有子项目/模块通用的配置选项。 
$ b buildscript {
repositories {
jcenter()
}
依赖关系{
classpath'com.android.tools.build:gradle: 1.5.0'

//注意:不要在这里放置您的应用程序依赖关系;它们属于单个模块build.gradle文件中的
//
}
}

allprojects {
存储库{
jcenter()



任务清理(类型:删除){
删除rootProject.buildDir
}

我的app.gradle文件如下:

  buildscript {
repositories {
maven {url'https://maven.fabric.io/public'}
}

依赖项{
classpath'io .fabric.tools:gradle:1. +'
}
}
apply plugin:'com.android.application'
apply plugin:'io.fabric'

知识库{
maven {url'https://maven.fabric.io/public'}
}


android {
compileSdkVersion 23
buildToolsVersion24.0.0

defaultConfig {
applicationIdtestfirebase.kishor.testproject18july2016
minSdkVersion 19
targetSdkVersi on 23
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android .txt'),'proguard-rules.pro'
}
}
}

依赖项{
编译fileTree(dir:'libs',包括:['* .jar'])
/ * testCompile'junit:junit:4.12'* /
compile'c​​om.android.support:appcompat-v7:23.1.1'
编译'com.android.support:design:23.1.1'
compile('com.crashlytics.sdk.android:crashlytics:2.6.0@aar'){
transitive = true;
}
}

目前我正在使用Android Studio版本1.5.1尝试2.1也,但没有运气。)
我搜索谷歌了很多,但无法找到确切的解决方案。


请帮忙。



谢谢。

解决方案

经过长时间的努力,我找到了一个解决方法。

其实问题的maven url: https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml



被重定向到以下网址:
https://s3.amazonaws.com/fabric-artifacts/public/io/fabric/tools/gradle/maven-metadata.xml



不知何故,在Android studio中,这个重定向失败了。因此,在app build.gradle 文件中,我替换了maven url。
from

  maven {url'https://maven.fabric.io/public'} 

  maven {url'http://s3.amazonaws.com/fabric-artifacts/public'} 

这解决了我的问题。

I have been trying to build the application which uses crashlytics from fabric.io. But build gets failed with bellow mentioned error.

Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources]

Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:classpath'.
   > Could not resolve io.fabric.tools:gradle:1.+.
     Required by:
         TestProject18July2016:app:unspecified
      > Could not resolve io.fabric.tools:gradle:1.+.
         > Failed to list versions for io.fabric.tools:gradle.
            > Unable to load Maven meta-data from https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml.
               > Could not GET 'https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml'.
                  > 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

Total time: 1.367 secs

My internet is behind proxy server. I have enabled both HTTP & HTTPS settings in gradle.properties file.

## Project-wide Gradle settings.
#
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Mon Jul 18 11:14:57 IST 2016
systemProp.http.proxyPassword=<PASSWORD>
systemProp.https.proxyUser=<USERID>
systemProp.https.proxyPort=<PORT>
systemProp.http.proxyHost=<PROXY_SERVER_ADDRESS>
systemProp.https.proxyPassword=<PASSWORD>
systemProp.https.proxyHost=<PROXY_SERVER_ADDRESS>
systemProp.http.proxyUser=<USERID>
systemProp.http.proxyPort=<PORT>

My build.gradle file is bellow:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.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
}

My app.gradle file is bellow:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 23
    buildToolsVersion "24.0.0"

    defaultConfig {
        applicationId "testfirebase.kishor.testproject18july2016"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
  /*  testCompile 'junit:junit:4.12'*/
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.0@aar') {
        transitive = true;
    }
}

Currently I am using Android Studio Version 1.5.1(Tried 2.1 also, but no luck.) I have searched google a lot, but not able to find exact solution.

Kindly Please help.

Thanks.

解决方案

After a long efforts I have identified a workaround for it.

Actually the problemetic maven url : https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml

was redirecting to bellow url : https://s3.amazonaws.com/fabric-artifacts/public/io/fabric/tools/gradle/maven-metadata.xml

Somehow in Android studio, this redirection was failing. So in app build.gradle file, I replaced the the maven url. from

  maven { url 'https://maven.fabric.io/public' }

to

 maven { url 'http://s3.amazonaws.com/fabric-artifacts/public' }

Which solved my problem.

这篇关于未通过身份验证:在Android Studio中构建应用时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆