Gradle error: Unable to convert provided notation to file or URI

I have updated android studio to 1.0 and auto Gradle from 1.0.0 from 0.12. +. My project is based on multi-project import, now I have fixed various bugs, but it remains one (hopefully 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.

      

Gradle project:

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
        }
    }
}

      

If there is a need for different Gradle modules, they send

+3


source to share





All Articles