zoukankan      html  css  js  c++  java
  • Android Studio3.5在编译项目出现连接不上gradle该怎么办?

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

    报错原因:

    Could not get resource ''

    网上说的解决方法都无效,增加了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
    }

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

  • 相关阅读:
    Spring AOP 实现原理
    Spring Aop实现方式总结
    Spring Aop重要概念介绍及应用实例结合分析
    Spring Aop
    常见的排序算法
    MINA2.0原理
    Java和Tomcat类加载机制
    Java 8 新特性概述
    Java类加载机制深度分析
    jetty之建立多Connector
  • 原文地址:https://www.cnblogs.com/wx18638101223/p/12535527.html
Copyright © 2011-2022 走看看