------------恢复内容开始------------

报错原因:

Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'

网上说的解决方法都无效,增加了SS代理也无

折腾了一会儿,好像可以了。

  1. 把项目中的build.gradle中google()和jcenter()注释掉,换成阿里云的就可以了。
  2. 将Android Studio中所有的代理全部取消
  3. 另外将~/.gradle/gradle.properties中关于代理的内容全部注释掉。

build.gradle内容改为如下:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
//google()
//jcenter()
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3' // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
} allprojects {
repositories {
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
//google()
//jcenter() }
} task clean(type: Delete) {
delete rootProject.buildDir
}

------------恢复内容结束------------

Android Studio3.5在编译项目出现连接不上gradle该怎么办?的更多相关文章

  1. Windows10+Android Studio 3.5编译项目报错——NDK Resolution Outcome: Project settings: Gradle model version=4.10.1, NDK version is UNKNOWN

    项目背景: 系统有C.D两个盘,Android Studio安装在D盘,sdk安装在C盘. 出现的问题: 从git拉取项目后,一直编译不通过,提示“NDK Resolution Outcome: Pr ...

  2. Android Studio3.1.2编译时Java Compiler出错:Warning: Failed to parse host proxy3.bj...

    删除gradle.properties中的代理设置... #移除下面配置systemProp.http.proxyHost=proxy3.bj.petrochina systemProp.http.p ...

  3. android studio 一次编译错误:Error:Minimum supported Gradle version is 2.14.1.

    因为需要,今天从git上重新下载工程到另一个目录下,结果运行的时候报了这个错:Error:Minimum supported Gradle version is 2.14.1.  Current ve ...

  4. android stdio 编译项目报Error:Failed to find target with hash string 'android-24

    android stdio 编译项目报Error:Failed to find target with hash string 'android-24 查看已有的SDK 设置项目的sdk为 25 an ...

  5. Android studio升级后原有项目无法正常编译运行问题

    Android studio工具升级后Gradle版本问题 背景 升级AndroidStudio到最新版本后,原来可正常编译输出AndroidTest的项目无法正常编译通过. 原因 升级后的Andro ...

  6. 关于Android Studio3.2新建项目无法运行出现Failed to find Build Tools revision 28.0.3的解决方法

    关于Android Studio3.2新建项目无法运行出现Failed to find Build Tools revision 28.0.3的解决方法 https://blog.csdn.net/h ...

  7. 浅谈Android Studio3.0更新之路(遇坑必入)

    >可以参考官网设置-> 1 2 >> Fantasy_Lin_网友评论原文地址是:简书24K纯帅豆写的我也更新一下出处[删除]Fa 转自脚本之家 浅谈Android Studi ...

  8. android最火的开源项目

    原文地址:http://www.csdn.net/article/2013-05-21/2815370-Android-open-source-projects-finale 此前,CSDN移动频道推 ...

  9. 【Android Studio安装部署系列】三十、从Android studio2.2.2升级到Android studio3.0之路

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 Android Studio 3.0的新功能 https://mp.weixin.qq.com/s/2XmVG4mKEDX6-bvZ ...

随机推荐

  1. 为什么 list(range) 比 [i for i in range()] 快?

    为什么 list(range) 比 [i for i in range()] 快? t0 = time.time() list(range(100000)) print(time.time()-t0) ...

  2. 保存vuex状态刷新不消失

    写在App.vue中,所有页面共享此方法 export default { name: "app", components: {}, created() { // 页面每次刷新加载 ...

  3. 第一课、python基础学习笔记

    自动化非自动化的区别 自动化测试就是让机器按照人的想法把功能全部跑一遍 自动化测试的过程,让我们写一段程序去测试另一段程序是否正常的过程 Java 编译型语言,   编码-->编译-->解 ...

  4. 发现新世界:神级浏览器插件TamperMonkey(暴力猴)

    由于谷歌浏览器各种受限 于是我就先使用火狐浏览器尝试此插件 步骤非常简单. 1.在火狐浏览器内打开如下网址:https://addons.mozilla.org/zh-CN/firefox/addon ...

  5. mongodb查询语句与sql语句对比

    左边是mongodb查询语句,右边是sql语句.对照着用,挺方便. db.users.find() select * from users db.users.find({"age" ...

  6. 记一次函数异常(getopt_long)

    前言 以下参考博客以及man手册. getopt_long函数,getopt_long函数包含了getopt函数的功能,并且还可以指定"长参数"(或者说长选项),与getopt函数 ...

  7. H5C3综合案例

    案例:实现步骤 1. 搭建HTML结构 <section> <div></div> <div></div> <div></ ...

  8. redis连接池参数动态化

    有的时候要从后端获取数据,真实的key可能在参数之上做一些修改,查了下set-misc模块,set_unescape_uri命令支持变量替换 location ~ /get_redis$ {      ...

  9. netty全局分析1

    这个系列都是别人的分析文 https://www.jianshu.com/p/ac7fb5c2640f 一丶 Netty基础入门 Netty是一个高性能.异步事件驱动的NIO框架,它提供了对TCP.U ...

  10. python基础入门语法和变量类型(二)

    列表 列表是 Python 中使用最频繁的数据类型,它可以完成大多数集合类的数据结构实现,可以包含不同类型的元素,包括数字.字符串,甚至列表(也就是所谓的嵌套). 和字符串一样,可以通过索引值或者切片 ...