gradle

proxy相关

studio->file->settings->appearance&behavior->systemsetting->http proxy->no proxy
c盘/user/你的用户名/.gradle/gradle.properties里最后如果有四行127.0.0.1啥的,把那四行删了
项目根目录下那个gradle.properties也如此

项目的gradle

repositories {
    google()
    jcenter()
    maven { url "https://jitpack.io" }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

app的gradle

    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.acha.learn"
        minSdkVersion 26
        targetSdkVersion 29

dependencies {里加需要的依赖
例如在github上找库
选择的时候根据star,insue的closed数,是否还active,document是否清晰,可扩展性等进行选择
Readme.md中一般有该库的依赖
如果是compile 'xxx'的库,需要把compile改为implementation,compile在新版本deprecated了
另外一些官方库也有依赖的路径变化,见link

posted @ 2020-02-12 22:14  _zwl  阅读(77)  评论(0)    收藏  举报