Could not find io.fabric.tools:gradle

Jemo Mgebrishvili picture Jemo Mgebrishvili · Oct 17, 2017 · Viewed 13.5k times · Source

I'm following official instructions of fabric

https://www.fabric.io/kits/android/crashlytics/install

This is my gradle.build file

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'

buildscript {
ext.kotlin_version = '1.1.51'
repositories {
    jcenter()
    mavenCentral()
    maven {
        url 'https://maven.google.com'
    }
}
dependencies {
...
    classpath 'io.fabric.tools:gradle:1.24.3'

    }
}

repositories {
    jcenter()
    mavenCentral()
    maven { url "https://jitpack.io" }
    maven {
        url 'https://maven.google.com'
    }
    maven { url 'https://maven.fabric.io/public' }

}

android {

compileSdkVersion 22

buildToolsVersion '25.0.3'
defaultConfig {
    ....
}

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

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

but when I try to sync my project, it says that could not find io.fabric.tools:gradle:1.24.3 searched in following locations:

Error:Could not find io.fabric.tools:gradle:1.24.3.
Searched in the following locations:

    file:/home/dev-00/soft/android-studio-3.0.0/android-studio/gradle/m2repository/io/fabric/tools/gradle/1.24.3/gradle-1.24.3.pom
    file:/home/dev-00/soft/android-studio-3.0.0/android-studio/gradle/m2repository/io/fabric/tools/gradle/1.24.3/gradle-1.24.3.jar
    https://jcenter.bintray.com/io/fabric/tools/gradle/1.24.3/gradle-1.24.3.pom
    https://jcenter.bintray.com/io/fabric/tools/gradle/1.24.3/gradle-1.24.3.jar
 ...    Required by:
    project :

Answer

Gabriele Mariotti picture Gabriele Mariotti · Oct 17, 2017

In your buildscript block you have to add also the fabric repo.

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

  dependencies {
     //......
  }
}