1 // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 3 buildscript { 4 5 repositories { 6 google() 7 jcenter() 8 mavenCentral() //修改此处,用maven{ url 'http://maven.aliyun.com/nexus/content/repositories/central/'}替换掉mavenCentral() 9 } 10 dependencies { 11 classpath 'com.android.tools.build:gradle:3.2.0' 12 13 14 // NOTE: Do not place your application dependencies here; they belong 15 // in the individual module build.gradle files 16 } 17 } 18 19 allprojects { 20 repositories { 21 google() 22 jcenter() 23 mavenCentral() //此处的mavencentral()也要替换 24 } 25 } 26 27 task clean(type: Delete) { 28 delete rootProject.buildDir 29 }@H_502_0@ @H_502_0@修改过后的build.gradle文件:
1 // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 3 buildscript { 4 5 repositories { 6 google() 7 jcenter() 8 maven{ url 'http://maven.aliyun.com/nexus/content/repositories/central/'} 9 } 10 dependencies { 11 classpath 'com.android.tools.build:gradle:3.2.0' 12 13 14 // NOTE: Do not place your application dependencies here; they belong 15 // in the individual module build.gradle files 16 } 17 } 18 19 allprojects { 20 repositories { 21 google() 22 jcenter() 23 maven{ url 'http://maven.aliyun.com/nexus/content/repositories/central/'} 24 } 25 } 26 27 task clean(type: Delete) { 28 delete rootProject.buildDir 29 }@H_502_0@ @H_502_0@重新编译一遍,ok。 @H_502_0@ @H_502_0@神秘代码:
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/central/'}@H_502_0@ @H_502_0@ @H_502_0@ @H_502_0@ @H_502_0@ @H_502_0@2、复制缺少的jar包的地址(报错信息里有),比如我的是https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.2.0/kotlin-stdlib-1.2.0.jar,使用迅雷下载,手动添加依赖。 @H_502_0@麻烦,容易出错,不推荐。 @H_502_0@ @H_502_0@不得不说迅雷还是很强,很多普通vpn搞不定的资源它还能下载。 @H_502_0@
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。