Gradle错误:无法将提供的表示法转换为文件或URI

时间:2014-12-14 16:08:37

标签: android maven android-studio

我将Android studio更新为1.0版本,并自动将Gradle插件从0.12。+添加到1.0.0。我的项目基于多项目导入,现在我修复了不同的错误,但它仍然是一个(希望:D)

Error:Cannot convert the provided notation to a File or URI: org.gradle.api.internal.artifacts.repositories.DefaultMavenLocalArtifactRepository_Decorated@272b7976.
The following types/formats are supported:
  - A String or CharSequence path, e.g 'src/main/java' or '/usr/include'
  - A String or CharSequence URI, e.g 'file:/usr/include'
  - A File instance.
  - A URI or URL instance.

Project gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
    }
}

project.ext.preDexLibs = !project.hasProperty('disablePreDex')
project.ext.compileSdkVersion = 19
project.ext.buildToolsVersion = '20.0.0'

project.ext.javaSourceVersion = JavaVersion.VERSION_1_7
project.ext.javaTargetVersion = JavaVersion.VERSION_1_7

allprojects {
    repositories {
        maven {
            url 'file///...something'
            artifactUrls mavenLocal()
        }
        maven { url "http://..something" }
        mavenCentral()
    }
}

subprojects {
    project.plugins.whenPluginAdded { plugin ->
        if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
            project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
        } else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
            project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
        }
    }
}

如果需要各种模块,请将它们贴上

0 个答案:

没有答案