在项目的 build.gradle或setting.gradle(Android Studio新老版本配置不同)中配置镜像源
阿里云:
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } maven { url 'https://maven.aliyun.com/repository/spring-plugin' } maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://jitpack.io' } 或 maven { url=uri("https://maven.aliyun.com/repository/gradle-plugin") } maven { url=uri("https://maven.aliyun.com/repository/spring-plugin") } maven { url=uri("https://maven.aliyun.com/repository/google") } maven { url=uri("https://maven.aliyun.com/repository/central") } maven { url=uri("https://maven.aliyun.com/repository/jcenter") } maven { url=uri("https://maven.aliyun.com/repository/public") } maven { url=uri("https://jitpack.io")}