Android Studio:无法找到请求目标的有效认证路径

时间:2018-07-16 12:36:33

标签: android android-studio gradle android-gradle

我要空白安装Android Studio,然后制作一个新的Android应用程序。尝试调试后,我得到“无法找到到请求目标的有效证书路径”。

现在我正在寻找解决方案的时间,但是更改cacerts文件对我来说不起作用。

app / build.gradle:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.da_ma.myapplication"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:design:28.0.0-alpha3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

应用程序build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        google()
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

原因:无法找到到所请求目标的有效认证路径

有任何想法吗?

1 个答案:

答案 0 :(得分:0)

在build.gradle中将所有https更改为http对我有用。 例如:-

   maven {
        url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
    }

收件人:-

 maven {
        url "http://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
    }

希望它对其他人也有用。