kyeonghwan
kyeonghwan

Reputation: 484

How can I solve it? `Failed to resolve: com.crashlytics.sdk.android:crashlytics:com.crashlytics.tools.gradle`

I was setting up a firebase's crashlytics on my app.

However, the following error occurred when the gradle build.

Things I've tried :

  1. To solve this problem, I tried to change the version and it was not resolved.

  2. And I changed the order of the repositories, but this was not the solution either.

============================================================

Error log is below

Failed to resolve: com.crashlytics.sdk.android:crashlytics:com.crashlytics.tools.gradle

And my gradle files are below.

buildscript {
    ext.kotlin_version = '1.2.61'
    ext.zxing = '3.3.3'
    ext.zxing_embedded = '3.6.0'
    ext.support_library = '28.0.0'
    ext.google_services = '4.2.0'
    ext.firebase = '16.0.5'
    ext.fabric_tools_gradle = '1.27.0'
    ext.crashlytics = '2.9.6'

    repositories {
        maven {url 'https://maven.fabric.io/public'}
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "com.google.gms:google-services:$google_services"
        classpath "io.fabric.tools:gradle:$fabric_tools_gradle"
    }

}

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

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


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

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "xxxxx.xxxxxxxxx" //blind
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 2
        versionName "1.0.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        debug {
            minifyEnabled true
            useProguard true
            shrinkResources false
            proguardFile getDefaultProguardFile('proguard-android.txt')
            proguardFile 'proguard-rules.pro'
            proguardFile 'proguard-zxing.pro'
            proguardFile 'progurad-support-design.pro'
        }

        release {
            minifyEnabled true
            useProguard true
            shrinkResources false
            proguardFile getDefaultProguardFile('proguard-android.txt')
            proguardFile 'proguard-rules.pro'
            proguardFile 'proguard-zxing.pro'
            proguardFile 'progurad-support-design.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    //kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    //test
//    testImplementation 'junit:junit:4.12'
//    androidTestImplementation 'com.android.support.test:runner:1.0.0'
//    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    //layout
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    //support library
    implementation "com.android.support:appcompat-v7:$support_library"   // Version 23+ is required
    implementation "com.android.support:design:$support_library"

    //zxing
    implementation("com.journeyapps:zxing-android-embedded:$zxing_embedded") { transitive = false }
    implementation "com.google.zxing:core:$zxing"

    //permission check util
    implementation 'rebus:permission-utils:2.0.7'

    // Add dependency
    implementation "com.crashlytics.sdk.android:crashlytics:$crashlytics"

    //firebase
    implementation "com.google.firebase:firebase-core:$firebase"
}

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

Upvotes: 3

Views: 2862

Answers (1)

Radesh
Radesh

Reputation: 13565

I don't sure but try this and tell me worked or not

change this

ext.crashlytics = '2.9.6'

To this

ext.crashlytics_version = '2.9.6'

And use it

 implementation "com.crashlytics.sdk.android:crashlytics:$crashlytics_version"

Upvotes: 5

Related Questions