【发布时间】:2017-10-26 11:37:02
【问题描述】:
当我尝试创建 Empty Activity 项目时,我在 Android Studio 2.3.2 中遇到以下错误。当我尝试导入项目时,我也得到了这个。
Error:Cause: unable to find valid certification path to requested target
这是我的毕业典礼
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// 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
}
和
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 25
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:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
我也试过用
替换jcenter()
jcenter {
url "http://jcenter.bintray.com/"
}
或者
maven {
url "http://repo1.maven.org/maven2"
}
我的 gradle 分发 url 指向最新
distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
我已经检查了不同论坛中的许多主题,但无法从中解决我的问题。
- Android Studio - Unable to find valid certification path to requested target
- Error:Cause: unable to find valid certification path to requested target
编辑: 由于 Android 社区似乎非常不活跃,我现在该怎么办?有人请至少和我一样在评论部分。
在我的另一台机器上,这个错误显示在一个 URL 中。我通过在手动下载后将 jar 放入 libs 文件夹解决了这个问题。但是对于这个问题,我找不到解决方案!
【问题讨论】:
标签: android android-studio ssl android-gradle-plugin gradle-plugin