1

I had an issue with gradle thinking I wanted multidex 1.0.2 so I setup the repository in the top level build file and moved it out of the buildscript (as per: Android Studio 3.0 Beta 1: Failed to resolve: com.android.support:multidex:1.0.2):

allprojects {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }
}

However, Fabric seems to dislike this. In the buildscript sections of my project (and library) I have:

buildscript {
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

And now I get:

Error:Could not find any matches for io.fabric.tools:gradle:1.+ as no versions of io.fabric.tools:gradle are available.
Searched in the following locations:
    file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/io/fabric/tools/gradle/maven-metadata.xml
    file:/Applications/Android Studio 3.0 Preview.app/Contents/gradle/m2repository/io/fabric/tools/gradle/
    https://jcenter.bintray.com/io/fabric/tools/gradle/maven-metadata.xml
    https://jcenter.bintray.com/io/fabric/tools/gradle/
Required by:
    project :

How can I resolve this conflict? How to I specify to fabric, if not in all projects, where to get its own dependencies?

MPelletier
  • 16,256
  • 15
  • 86
  • 137

2 Answers2

1

Error:Could not find any matches for io.fabric.tools:gradle:1.+ as no versions of io.fabric.tools:gradle are available.

It happens since gradle is looking for the plugin only in the jcenter repo.

To setup fabric you have to use it:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

It is required by the gradle plugin.

Then you have to add:

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

It is used by the dependencies added in the projects.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
0

A colleague managed to resolve it with the following declaration in the app's build.gradle file:

repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'https://maven.google.com' }
}
MPelletier
  • 16,256
  • 15
  • 86
  • 137