1. android studio 快速入门

build.gradle

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()
    }
}

https://services.gradle.org/distributions/

把android studio先关掉。
打开.gradle/wrapper/dists目录,找到distributionUrl所指定的那个版本号文件夹。
1)从网上下载https://services.gradle.org/distributions/相应的 gradle-4.4-all.zip,放到文件夹里,并解压
2)把.part删除掉
3)创建 gradle-4.4-all.zip.ok (很关键!!!)
4)启动android studio,正常sync
snowdreams1006@snowdreams1006deMacBook-Pro mycustomer % tree ~/.gradle/wrapper/dists/gradle-4.10.2-all -L 3
/Users/snowdreams1006/.gradle/wrapper/dists/gradle-4.10.2-all
└── 9fahxiiecdb76a5g3aw9oi8rv
    ├── gradle-4.10.2
    │   ├── LICENSE
    │   ├── NOTICE
    │   ├── bin
    │   ├── docs
    │   ├── getting-started.html
    │   ├── init.d
    │   ├── lib
    │   ├── media
    │   ├── samples
    │   └── src
    ├── gradle-4.10.2-all.zip
    ├── gradle-4.10.2-all.zip.lck
    └── gradle-4.10.2-all.zip.ok

9 directories, 6 files
作者: 雪之梦技术驿站
链接: https://snowdreams1006.github.io/todo/gitignore-as.html
来源: 雪之梦技术驿站
本文原创发布于「雪之梦技术驿站」,转载请注明出处,谢谢合作!

https://snowdreams1006.github.io/snowdreams1006-wechat-open.png

© snowdreams1006 all right reserved,powered by Gitbook文件修订时间: 2020-09-18 08:31:07

results matching ""

    No results matching ""