Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't build android app with crashlytics

I am trying to upgrade from crashlytics 1.x to Fabric in an android app. I've modified the build.gradle file to match the example here - https://fabric.io/downloads/gradle

But on build I get - Error:Failed to resolve: com.crashlytics.sdk.android:crashlytics:2.5.5

I'm using Android studio 1.5.1 and I have the Fabric plugin installed. What else do I need to do?

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'http://repository-nutiteq.forge.cloudbees.com/release/' }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.library'
apply plugin: 'io.fabric'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    useLibrary  'org.apache.http.legacy'

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 23
        multiDexEnabled true
    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    dexOptions {
        jumboMode = true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/maven/com.squareup.okhttp/okhttp/pom.properties'
    }


}

repositories {
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'http://repository-nutiteq.forge.cloudbees.com/release/' }

}


dependencies {
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.squareup.okhttp3:okhttp:3.1.2'
    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }

    // some removed

}
like image 536
smokey_the_bear Avatar asked Feb 17 '16 00:02

smokey_the_bear


1 Answers

I had the same problem and solved it by adding

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

in build.gradle (project)

like image 159
Sirena Avatar answered Oct 23 '22 07:10

Sirena