Connect to maven.google.com:443 [maven.google.com/172.217.27.142] failed: connect timed out 解决 [Solved]

 android  Connect to maven.google.com:443 [maven.google.com/172.217.27.142] failed: connect timed out 解决 [Solved]已关闭评论
6月 252021
 

android studio编译项目时一直卡在下面的提示:

“Connect to maven.google.com:443 [maven.google.com/172.217.27.142] failed: connect timed out ”, 可以使用下面的方式解决(Solved),

直接修改build.gradle文件中Google的maven地址(添加黑体字的行):

repositories {
    maven{ url 'https://maven.aliyun.com/repository/google'}
    maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'}
    maven{ url 'https://maven.aliyun.com/repository/public'}
    maven{ url 'https://maven.aliyun.com/repository/jcenter'}
    maven {url 'https://dl.google.com/dl/android/maven2/'}
    jcenter() ...... 
} DONE!