对于android项目报错,首先sync gradle,sync with file system,clean project,rebuild project,删除项目下app中的build,C盘下的
多试一下,如果不行往就下看
- 1. ERROR: Could not find com.android.tools.build:gradle:3.5.1.
- 解决办法:在build.gradle中下面位置加入google() 此处是原博客
buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.1' } } allprojects { repositories { google() jcenter() } }
- 2. ERROR: Unknown host 'dl.google.com'. You may need to adjust the proxy settings in Gradle.
- 解决办法:C:\Windows\System32\drivers\etc\hosts文件最后加入203.208.40.36 dl.google.com(先将文