博客
关于我
Android Studio同步Gradle失败的解决办法
阅读量:397 次
发布时间:2019-03-05

本文共 1192 字,大约阅读时间需要 3 分钟。

一、解决办法。

修改build.gradle,如下图所示。

工程里是有两个build.grade,这里是后面带Project:的grade文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {    repositories {        maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}    }    dependencies {        classpath 'com.android.tools.build:gradle:3.5.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/repositories/google' }        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}    }    tasks.withType(Javadoc) { // 新增        options.addStringOption('Xdoclint:none', '-quiet')        options.addStringOption('encoding', 'UTF-8')    }}task clean(type: Delete) {    delete rootProject.buildDir}

其中

classpath 'com.android.tools.build:gradle:3.5.2'需要根据自己的Android Studio版本来修改

可以在Help->About中查看Android Studio版本。

重新同步,这里需要联网的。

2、其它。

笔者尝试过重装、添加证书、换国内aliyun的镜像,都失败了。

原因是国内的aliyun换网址了,上文中的网址在2020/4/27测试成功。

 

转载地址:http://hbiwz.baihongyu.com/

你可能感兴趣的文章
mapping文件目录生成修改
查看>>
MapReduce程序依赖的jar包
查看>>
mariadb multi-source replication(mariadb多主复制)
查看>>
MaterialForm对tab页进行隐藏
查看>>
Member var and Static var.
查看>>
memcached高速缓存学习笔记001---memcached介绍和安装以及基本使用
查看>>
memcached高速缓存学习笔记003---利用JAVA程序操作memcached crud操作
查看>>
Memcached:Node.js 高性能缓存解决方案
查看>>
memcache、redis原理对比
查看>>
memset初始化高维数组为-1/0
查看>>
Metasploit CGI网关接口渗透测试实战
查看>>
Metasploit Web服务器渗透测试实战
查看>>
Moment.js常见用法总结
查看>>
MongoDB出现Error parsing command line: unrecognised option ‘--fork‘ 的解决方法
查看>>
MongoDB学习笔记(8)--索引及优化索引
查看>>
ms sql server 2008 sp2更新异常
查看>>
MS UC 2013-0-Prepare Tool
查看>>
msbuild发布web应用程序
查看>>
MSCRM调用外部JS文件
查看>>
MSEdgeDriver (Chromium) 不适用于版本 >= 79.0.313 (Canary)
查看>>