当我同步毕业时,我在
Android Studio 2.2.3中收到以下错误.
错误:原因:无法找到有效的认证路径到请求的目标
我如何解决这个问题
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文件
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 }
解决方法
我早期面对Maven构建这个问题.这是因为我在有限的办公室网络中工作.您需要在密钥库中导入所需的证书.
按照以下问题的答案中的步骤
“unable to find valid certification path to requested target”,but browser says it’s OK
(为fienames / pathnames使用双引号)
注意:我现在找不到从哪里解决问题的确切来源,如果我得到它,我会更新它