美文网首页
AndroidStudio开发小技巧--使用阿里云仓库

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

作者: 小于先森 | 来源:发表于2021-03-16 16:57 被阅读0次

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

相关文章

网友评论

      本文标题:AndroidStudio开发小技巧--使用阿里云仓库

      本文链接:https://www.haomeiwen.com/subject/nmvdcltx.html