错误:原因:无法找到到请求目标的有效证书路径 [英] Error:Cause: unable to find valid certification path to requested target

查看:632
本文介绍了错误:原因:无法找到到请求目标的有效证书路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我同步gradle时,我在android Studio 2.2.3中遇到以下错误.

I got the following Error in android Studio 2.2.3 when I sync gradle.

错误:原因:无法找到指向所请求目标的有效证书路径

如何解决此问题

我也在添加我的Gradle文件

I am Adding my Gradle file also

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "com.sample.myapplication"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
} } dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:palette-v7:23.4.0'
testCompile 'junit:junit:4.12'
// FireBase
compile 'com.google.firebase:firebase-messaging:9.0.0'
}//Add this line
apply plugin: 'com.google.gms.google-services'

和项目级别Gradle文件

and the project Level Gradle File

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
    mavenCentral()
    jcenter{ url "http://jcenter.bintray.com/" }
    maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

推荐答案

我遇到了同样的问题,但是通过添加解决了该问题

I faced the same issue, but fixed it by adding

maven { url "http://jcenter.bintray.com"}

项目级别Gradle文件中

buildscript {
repositories {
    jcenter()
    maven { url "http://jcenter.bintray.com"}
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
    mavenCentral()
    jcenter{ url "http://jcenter.bintray.com/" }
    maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

这篇关于错误:原因:无法找到到请求目标的有效证书路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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