runliuv

runliuv@cnblogs

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

引用:https://www.cnblogs.com/caoxinyu/p/10568462.html

 

build.gradle 可能有多个,一般在app 节点,默认里面不包含buildscript,allprojects 这两项。
把这段代码加入 build.gradle (Moudle:app) 尾部:

buildscript {
    
    repositories {
        maven{ url = "http://maven.aliyun.com/nexus/content/groups/public/" }
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven{ url = "http://maven.aliyun.com/nexus/content/groups/public/" }
        google()
        jcenter()
    }
}


posted on 2020-04-09 19:44  runliuv  阅读(3273)  评论(0编辑  收藏  举报