AndroidStudio开发小技巧--使用阿里云仓库

Title

适用于因某些原因无法访问google等仓库无法编译。

Body

阿里云仓库官网(我是网址

选择需要的仓库地址


在这里插入图片描述

然后将需要的仓库写入项目根目录的build.gradle中。
示例:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.41'
    repositories {
//        google()
//        jcenter()
        maven { url 'https://maven.aliyun.com/repository/public' }//jcenter
        maven { url 'https://maven.aliyun.com/repository/google' }//google
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
//        classpath 'com.loveota.plugins:lbplugin:latest.release'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
//        google()
//        jcenter()
        maven { url 'https://maven.aliyun.com/repository/public' }//jcenter
        maven { url 'https://maven.aliyun.com/repository/google' }//google
    }
}

Over

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容