1.出现Could not get resource ‘https://dl.google.com/ 的处理
- What went wrong:
A problem occurred evaluating project ':app'.
Could not resolve all artifacts for configuration 'classpath'. Could not resolve com.android.tools.build:gradle:4.1.0. Required by: unspecified:unspecified:unspecified Could not resolve com.android.tools.build:gradle:4.1.0. Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'. Could not HEAD 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'. Connect to dl.google.com:443 [dl.google.com/203.208.46.146] failed: Connection timed out: connect
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
- Get more help at Gradle | Search for Help with Gradle Build Tool
BUILD FAILED in 1m 16s
Exception: Gradle task assembleDebug failed with exit code 1
解决:
修改host文件
203.208.40.33 dl.google.com
203.208.40.33 dl-ssl.google.com
203.208.40.33 www.google.com