Android studio 3.1.4 无法获取pom文件

之前用Android studio一切正常,不过昨天下午突然报出这样的错误:Could not GET ‘https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom’.
在这里插入图片描述
试了很多办法,折腾了大半天终于让我给弄好了,具体办法如下:
1.File->Settings->Build,Execution,Deployment->Gradle->Android Studio,把这个对勾打上
~~在这里插入图片描述~~
现在重新试一下,如果好了就忽略下面的步骤
2.要是还不行那就在build.gradle中添加
maven { url ‘http://maven.aliyun.com/nexus/content/groups/public/’ }
添加之后如下所示:

// 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/groups/public/' }
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        
        // 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()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

现在再试一次,反正我是成功了,希望能帮到你。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值