Could not resolve all artifacts for configuration ':classpath'.


“org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$Artifact” Could not resolve all artifacts for configuration ':classpath'.

從網上搜了很多的辦法,大多是在build.gradle里加上阿里雲的鏡像或者其他的鏡像

反正我試了這些辦法后都沒用,用了我一上午的時間都沒整好他,大家可以試試

https://blog.csdn.net/m0_46278918/article/details/105812376

https://blog.csdn.net/wwongcong/article/details/99597655

https://blog.csdn.net/X_kine/article/details/104741771

 

最后我是無意間看到了一個評論,他給出了一個解決辦法,我就抱着試試的態度,結果還真解決了

解決辦法:

1、首先修改根目錄下的build.gradle成如下格式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
   repositories {
   }
   dependencies {
     classpath 'com.android.tools.build:gradle:3.6.1'
 
     // NOTE: Do not place your application dependencies here; they belong
     // in the individual module build.gradle files
   }
}
allprojects {
   repositories {
//    google()
//    jcenter()
   }
}

2、然后點擊sync project with gradle files,如下圖所示

3、 如果再次報錯請清理緩存並重啟AS,方法如下圖

 

 

 

4、(最重要的步驟)如果再次報錯,請不厭其煩的且厚不要臉的多次點擊這個小象(即重復第二步操作),正常情況下奇跡會發生的。(反正我是見證該奇跡了)

到此這篇關於解決Android studio 3.6.1 出現Cause: unable to find valid certification path to requested target

 

參考文章:https://www.jb51.net/article/182527.htm

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM