Failed to resolve common open file gradle.build

我是研究僧i 提交于 2019-12-04 22:37:24

I was having the same issue after a git pull of a working project from one computer to another. What finally resolved it was making sure the project gradle file listed google() and had it before jcenter(). Final working form in ProjectDir/build.gradle looks like:

allprojects {
    repositories {
        google()
        jcenter()
    }
}

I am using Gradle 4.4 and the Android Studio Gradle plugin 3.1.3

Why it was working on one computer and not on the other one, I have no idea.

Solved when I wrote this code in Gradle:project

 buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.1'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    }
}

allprojects {
  repositories {
      google()
      jcenter()
  }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!