Could not resolve io.fabric.tools:gradle:1.+

Sam picture Sam · Jun 2, 2017 · Viewed 46.4k times · Source

I'm having an issue with building my project. First time build. I'm behind a proxy and all other dependencies downloaded only this having an issue.

I tried a few options found on SO, but had no luck so far. Can someone give me a clue on how to fix this?

Things I tried so far:

  • File -> Invalidate Cache/Restart -> Invalidate and Restart
  • updated the crashlytics:2.5.5@aar to crashlytics:2.6.4@aar
  • restarted Android Studio
  • I'm not in offline mode

app/build.gradle

buildscript {
    repositories {
        maven { url https://maven.fabric.io/public }
        mavenCentral()
        jcenter()
    }
}

apply plugin: 'io.fabric'

dependencies {
    compile("com.crashlytics.sdk.android:crashlytics:2.5.5@aar") {
        transitive = true
    }
}

Root build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

Error:

Failed to list versions for io.fabric.tools:gradle.
  Unable to load Maven meta-data from https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml.
    Could not GET 'https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml'.
      Connect to maven.fabric.io:443 [maven.fabric.io/54.230.133.33] failed: Connection refused: connect
Could not resolve io.fabric.tools:gradle:1.+.
  Failed to list versions for io.fabric.tools:gradle.
    Unable to load Maven meta-data from https://jitpack.io/io/fabric/tools/gradle/maven-metadata.xml.
      Could not GET 'https://jitpack.io/io/fabric/tools/gradle/maven-metadata.xml'.
        Connect to jitpack.io:443 [jitpack.io/104.24.23.62, jitpack.io/104.24.22.62] failed: Connection refused: connect
Could not resolve io.fabric.tools:gradle:1.+.
  Failed to list versions for io.fabric.tools:gradle.
    Unable to load Maven meta-data from https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml.
      Could not GET 'https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml'.
        Connect to repo1.maven.org:443 [repo1.maven.org/151.101.24.209] failed: Connection refused: connect
Could not resolve io.fabric.tools:gradle:1.+.
  Failed to list versions for io.fabric.tools:gradle.
    Unable to load Maven meta-data from https://jcenter.bintray.com/io/fabric/tools/gradle/maven-metadata.xml.
      Could not GET 'https://jcenter.bintray.com/io/fabric/tools/gradle/maven-metadata.xml'.
        Connect to jcenter.bintray.com:443 [jcenter.bintray.com/75.126.118.188] failed: Connection refused: connect

Answer

Tandoh Anthony Nwi-Ackah picture Tandoh Anthony Nwi-Ackah · Jun 21, 2017

Came across the same issue. i resolve it by installing the latest fabric plugin for android studio.

Add the following to the build.gradle .

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

        classpath 'io.fabric.tools:gradle:VVV'
    }
}
apply plugin: 'io.fabric'

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

WHERE VVV is the latest version. In my case VVV IS 1.31.2

Add this to the manifest

<meta-data
            android:name="io.fabric.ApiKey"
            android:value="xxxxxxxxxxxxxxxxxxxxxxx" />

where xxxxxxxxxxxxxxxx is your obtained value.

Add this to your launcher class.

Fabric.with(this, Crashlytics())

Rebuild project and you are good to go.