Could not resolve io.fabric.tools:gradle:1.+
Asked Answered
T

12

30

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
Terrellterrena answered 2/6, 2017 at 0:33 Comment(2)
Possible duplicate of Crashlytics Error:(11, 0) Plugin with id 'io.fabric' not found compile libMontage
Just install Fabric plugin for the ASDivulgence
L
13

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.

Lactam answered 2/6, 2017 at 1:25 Comment(4)
where i should specify proxy settings in Android Studio or Gradle prop fileTerrellterrena
Both I guess. but in your case it is probably Gradle where it is missing. You can also verify this by trying to execute the build from the command line.Lactam
im not behind a proxy though?Deduction
This occurred to me when I was not connected to the internet. Fixing the network solved the issue for me.Footwall
L
28

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.

Loathly answered 21/6, 2017 at 12:5 Comment(4)
is this settings goes to project/build.gradle or Module/build.gradleTerrellterrena
goes to build.gradle(Module:app) @ SamLoathly
Thanks @Tandoh. I got the latest version at maven.fabric.io/public/io/fabric/tools/gradle/…Miran
firebase.google.com did not load for me. I was resolved by changing the IP and using the VPN , The problem was solved when the website loaded for me and I try to rebuilt app.Peruke
L
13

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.

Lactam answered 2/6, 2017 at 1:25 Comment(4)
where i should specify proxy settings in Android Studio or Gradle prop fileTerrellterrena
Both I guess. but in your case it is probably Gradle where it is missing. You can also verify this by trying to execute the build from the command line.Lactam
im not behind a proxy though?Deduction
This occurred to me when I was not connected to the internet. Fixing the network solved the issue for me.Footwall
I
7

Edit Project Gradle like this

buildscript {

repositories {
    google()
    jcenter()
    maven {
        url 'https://maven.fabric.io/public'
    }
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.4'
    classpath 'com.google.gms:google-services:3.3.0'
    classpath 'io.fabric.tools:gradle:1.25.4'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    google()
    jcenter()
    maven {
        url 'https://maven.google.com/'
    }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Isolation answered 24/8, 2018 at 16:19 Comment(0)
R
6

I tried adding maven repo url but did not work, problem is that Firebase Crashlytics have decided to change their dependency name from

io.fabric.tools:gradle

to

com.google.firebase:firebase-crashlytics-gradle

with the aquisition of Fabric by Firebase.

So instead of

classpath "io.fabric.tools:gradle:1.25.4"

use

classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.0'

and also change the

apply plugin: 'io.fabric'

to

apply plugin: 'com.google.firebase.crashlytics'

References

Reinaldoreinaldos answered 22/5, 2020 at 2:5 Comment(0)
K
4

This error:

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

happens when the option "Offline work", located in Settings->Build, Execution, Deployment->Gradle->Global Gradle settings is selected.

To solve the problem, you have to change:

From: io.fabric.tools:gradle:1.+

To: io.fabric.tools:gradle:1.0

When you do, Android Studio itself will warn you about the latest version. In my case it was: 1.25.4. So, in my case, it was like this:

dependencies { 
    classpath 'com.android.tools.build:gradle:3.2.0' 
    classpath 'io.fabric.tools:gradle:1.25.4' 
}

I hope it helps someone else.

Klemm answered 6/6, 2018 at 20:52 Comment(0)
L
4

Faced the same issue, resolved with upgrading the fabric gradle to the latest version. Below is the code,

dependencies {
    classpath 'io.fabric.tools:gradle:1.25.4'
}
Latreshia answered 5/7, 2018 at 3:20 Comment(0)
U
2

I had the same problem, just make sure you follow these steps so crashlytics will be installed successfully:

1) add this in your project level gradle:

buildscript {
    repositories {
        google()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'io.fabric.tools:gradle:1.27.1'
    }
}
allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
}

2) In your app level gradle

in the very beginning of the file add:

apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'

and in the dependencies block add:

implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'

After adding all of that, it has finally worked for me. Hope it helps. Cheers

Ulibarri answered 2/5, 2019 at 6:43 Comment(0)
P
1

Well, first add these to gradle.properties(Project Properties)

For http use:

systemProp.http.proxyHost=your_proxy_host
systemProp.http.proxyPort=your_proxy_port
systemProp.http.proxyUser=your_proxy_username
systemProp.http.proxyPassword=your_proxy_password

For https use:

systemProp.https.proxyHost=your_proxy_host
systemProp.https.proxyPort=your_proxy_port
systemProp.https.proxyUser=your_proxy_username
systemProp.https.proxyPassword=your_proxy_password

Then got to File -> Settings -> Appearance & Behavior -> System Settings -> HTTP Proxy, select Manual Proxy Configuration, select HTTP, enter Host name, enter Port number, select Proxy authentication, enter login(your proxy username), enter password(your proxy password), (note you can optionally Check connection)then Apply and OK. Done!!!

Preposterous answered 30/4, 2018 at 9:53 Comment(1)
Tried setting both the options but still same error.Aggri
F
1

Use this link to find the latest fabric gradle plugin

Latest Fabric Gradle Plugin

Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds (io.fabric.tools:gradle:1.+)

Using + in dependencies lets you automatically pick up the latest available version rather than a specific, named version. However, this is not recommended; your builds are not repeatable; you may have tested with a slightly different version than what the build server used. (Using a dynamic version as the major version number is more problematic than using it in the minor version position.)

Facial answered 20/5, 2018 at 21:21 Comment(0)
Y
0

I get this issue, i solved it by enabling gradle offline support, if you don't want to repeat this issue again in future.

I will suggest you to enable gradle offline support, it will solve the issue.

You can easily disable/enable offline support at anytime you want in future.

Please check the following

Go to Preferences > Gradle and check/uncheck "Offline work".

Gradle Offline check/uncheck

Yorke answered 9/1, 2019 at 2:41 Comment(0)
R
0
    *Add the following in your project/build.gradle**
    buildscript {

    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {

        classpath 'io.fabric.tools:gradle:1.25.4'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    }

**Add the following in your app/build.gradle**

 apply plugin: 'io.fabric'//on top 

   dependencies {
    //Crashlytics
   implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
}
Rubber answered 22/4, 2019 at 12:35 Comment(0)
H
0

It might be because the domain is blacklisted by https://github.com/notracking/hosts-blocklists which uses various of sources to collect a blacklist https://github.com/notracking/hosts-blocklists/blob/master/SOURCES.md

As a workaround you could overwrite the blacklisted entry (dnsmasq example)

# conf-file=/etc/dnsmasq/blocked_domains.txt
address=/fabric.io/50.19.118.60
address=/maven.fabric.io/99.86.238.75

The IP adresses might change. You'll have to check yourself.

or use the IP instead of the hostname in build.gradle

Hansiain answered 30/4, 2020 at 7:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.