Android Build Error org.gradle.api.internal

时间:2019-01-17 12:45:27

标签: java android gradle

嗨,我正在尝试在android studio中构建应用程序,但出现以下错误,我无法弄清build.gradle文件出了什么问题。

org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':classpath'.
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:918)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1600(DefaultConfiguration.java:116)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:892)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:404)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:68)
at org.gradle.internal.classpath.DefaultClassPath.<init>(DefaultClassPath.java:48)
at org.gradle.api.internal.initialization.DefaultScriptClassPathResolver.resolveClassPath(DefaultScriptClassPathResolver.java:39)
at org.gradle.api.internal.initialization.DefaultScriptHandler.getScriptClassPath(DefaultScriptHandler.java:72)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.defineScriptHandlerClassScope(DefaultPluginRequestApplicator.java:204)...

这是我的build.gradle文件

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

allprojects {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        maven {
            url "http://dl.bintray.com/piasy/maven"
        }
        flatDir {
            dirs 'libs'
        }
    }
}

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

0 个答案:

没有答案