gpt4 book ai didi

java - gradle同步时sun.security.validator.ValidatorException

转载 作者:行者123 更新时间:2023-12-03 04:21:08 26 4
gpt4 key购买 nike

从星期一开始,我面临与sun.security.ValidatorException相关的问题。在上周一之前,一切正常。

异常(exception)是:
配置根项目“CoreApp”时发生问题。

Could not resolve all files for configuration ':classpath'. Could not download gradle.jar (com.android.tools.build:gradle:3.1.2) Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.jar'. Could not HEAD 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.2/gradle-3.1.2.jar'. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Could not download sdk-common.jar (com.android.tools:sdk-common:26.1.2) Could not get resource 'https://jcenter.bintray.com/com/android/tools/sdk-common/26.1.2/sdk-common-26.1.2.jar'. Could not HEAD 'https://jcenter.bintray.com/com/android/tools/sdk-common/26.1.2/sdk-common-26.1.2.jar'. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Could not download sdklib.jar (com.android.tools:sdklib:26.1.2) Could not get resource 'https://jcenter.bintray.com/com/android/tools/sdklib/26.1.2/sdklib-26.1.2.jar'. Could not HEAD 'https://jcenter.bintray.com/com/android/tools/sdklib/26.1.2/sdklib-26.1.2.jar'. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Cause: unable to find valid certification path to requested target



我的应用程序级别gradle是:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {

applicationId "com.package.app"
minSdkVersion 16
targetSdkVersion 27
versionCode 2000044
versionName "4.1.1"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "3g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support:design:27.1.1'
compile 'com.google.firebase:firebase-core:15.0.2'
compile 'com.google.firebase:firebase-config:15.0.2'
compile 'com.google.firebase:firebase-messaging:15.0.2'
compile 'com.google.android.gms:play-services-tagmanager:15.0.2'
compile 'com.google.android.gms:play-services-auth:15.0.0'
compile 'com.google.android.gms:play-services-maps:15.0.0'
compile 'com.google.android.gms:play-services-location:15.0.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
//compile 'com.google.firebase:firebase-crash:12.0.1'
compile 'com.crashlytics.sdk.android:crashlytics:2.9.2'
compile 'com.facebook.android:facebook-android-sdk:4.31.0'
compile 'com.appsflyer:af-android-sdk:4.8.9@aar'
compile 'com.android.installreferrer:installreferrer:1.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.3'
}
apply plugin: 'com.google.gms.google-services'

项目级别的 yield 是:
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.25.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
google()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

我不知道是什么问题。请帮助我由于此错误而无法进行开发。

最佳答案

不久前我遇到了类似的问题,我做了以下工作

  • 确保您已禁用脱机工作表单项目设置
  • 如果在Windows上工作,则只需清除gradle缓存(see this),然后同步项目。它应该工作。
  • 关于java - gradle同步时sun.security.validator.ValidatorException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50602986/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com