Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Crashlytics build error: "could not find io.fabric.tools:gradle:1.26.1"

I was trying to integrate Firebase Crashlytics on my react native app but got this error while building the app.

  • What went wrong: A problem occurred configuring root project 'MyApp'.

Could not resolve all artifacts for configuration ':classpath'. Could not find io.fabric.tools:gradle:1.26.1. Searched in the following locations: https://dl.google.com/dl/android/maven2/io/fabric/tools/gradle/1.26.1/gradle-1.26.1.pom https://dl.google.com/dl/android/maven2/io/fabric/tools/gradle/1.26.1/gradle-1.26.1.jar https://repo.maven.apache.org/maven2/io/fabric/tools/gradle/1.26.1/gradle-1.26.1.pom https://repo.maven.apache.org/maven2/io/fabric/tools/gradle/1.26.1/gradle-1.26.1.jar https://jcenter.bintray.com/io/fabric/tools/gradle/1.26.1/gradle-1.26.1.pom https://jcenter.bintray.com/io/fabric/tools/gradle/1.26.1/gradle-1.26.1.jar

Required by: project :

  • Try:

I've added classpath 'io.fabric.tools:gradle:1.26.1' in dependencies and

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

in repositories in build.gradle as suggested in documentation.

like image 853
aryalprakash Avatar asked Jan 31 '19 11:01

aryalprakash


2 Answers

Before, I got the same issue because I moved the url 'https://maven.fabric.io/public' to the wrong place

I guess you guy also same. My working build.grande is

buildscript {
    repositories {
        google()
        jcenter()
        // Additional repository for fabric resources
        maven {
            url 'https://maven.fabric.io/public'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.google.gms:google-services:4.2.0'
        // Add fabric classpath
        classpath 'io.fabric.tools:gradle:1.26.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

like image 191
Phat Tran Avatar answered Oct 13 '22 09:10

Phat Tran


As per the documentation of the fabric integration.

Try using this as a sub-library of the project.

In your app's Gradle mention the below code. It will work.

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
like image 2
Brijesh Joshi Avatar answered Oct 13 '22 10:10

Brijesh Joshi