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.是否是你需要的版本。(当然这无关紧要)
直接在:
buildscript { repositories { google() // 这里把google补上 jcenter() } dependencies { classpath "com.android.tools.build:gradle:4.0.2" } }