you need to adjust the ‘metadataSources { ... }‘ of the repository declaration.

分手后的思念是犯贱 2024-05-03 14:40 165阅读 0赞

Could not find com.android.tools.build:gradle:4.0.2.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.2/gradle-4.0.2.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in ‘Maven POM’ format, you need to adjust the ‘metadataSources { … }‘ of the repository declaration.
Required by:
project :
Add Google Maven repository and sync project
Open File

解决办法:

判断当前的

com.android.tools.build:gradle:4.0.2.是否是你需要的版本。(当然这无关紧要)

直接在:

  1. buildscript {
  2. repositories {
  3. google() // 这里把google补上
  4. jcenter()
  5. }
  6. dependencies {
  7. classpath "com.android.tools.build:gradle:4.0.2"
  8. }
  9. }

发表评论

表情:
评论列表 (有 0 条评论,165人围观)

还没有评论,来说两句吧...

相关阅读