Could not find io.fabric.tools:gradle

15,505

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

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

  dependencies {
     //......
  }
}
Share:
15,505
Jemo Mgebrishvili
Author by

Jemo Mgebrishvili

Kt. & Android developer.

Updated on June 27, 2022

Comments

  • Jemo Mgebrishvili
    Jemo Mgebrishvili about 2 years

    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 :
    
  • Jemo Mgebrishvili
    Jemo Mgebrishvili over 6 years
    o right :/ now error is gone, but I can't use any instance of Fabric or Crashlytic for example: Fabric.with(this, new Crashlytics()); says cannot resolve symbol Fabric
  • Gabriele Mariotti
    Gabriele Mariotti over 6 years
    Try to clean, but this is some separate problem. It has nothing to do with your question. You may wish to consider asking a separate question
  • Tope
    Tope over 6 years
    note that I had to move this to the top level buildscripts.repositories object block in the file. It did not work when the maven url entry was made under the allprojects.buildscripts.repositories object block of the file my allprojects
  • King Julien
    King Julien over 5 years
    Topes comment in correct. You should add the repo in buildscripts.repositories.