Search code examples
androidgradlecrashlyticstwitter-fabric

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


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

Solution

  • Well, the error seems pretty clear to me. You cannot connect to either of the repositories via HTTPS. As it is unlikely that all those are down and you already said you are behind a proxy, configure the HTTPS proxy via Gradle properties as described in the user's guide and you should be fine.

    If your proxy is configured properly on Gradle side, maybe the proxy blocks the requests due to some condition. In that case you should probably ask the maintainer of that proxy.