Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

crashlytics android studio gradle build failed

I have installed crashlytics plugin to android studio 0.9.3; after this I added to my project; It added lines to gradle, first activity and so on...; after this build fails with this error:

Error:Execution failed for task ':app:fabricCleanupResourcesDebug'.

Crashlytics Developer Tools error.

enter image description here

Here is my gradle file, what should I change ? Crashlytics added it's lines automatically:

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'

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

android {
  compileSdkVersion 21
  buildToolsVersion "21.0.2"

  defaultConfig {
    applicationId "XXXXXXXXXXXXXXXXXXXXXXX"
    minSdkVersion 11
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
  }
  buildTypes {
    release {
      runProguard false
      proguardFiles getDefaultProguardFile('proguard-android.txt'),
      'proguard-rules.pro'
    }

  }
}

dependencies {
  compile fileTree(dir : 'libs', include : ['*.jar'])
  compile 'com.android.support:appcompat-v7:21.0.0'
  compile('com.crashlytics.sdk.android:crashlytics:2.1.0@aar') {
    transitive = true;
  }
}

.

like image 214
Misha Akopov Avatar asked Dec 08 '14 13:12

Misha Akopov


2 Answers

I just had the exact same issue after replacing the API Key in the AndroidManifest.xml file by a string reference instead of a literal string.
Using the literal string, the error disappeared.

Use

<meta-data
        android:name="com.crashlytics.ApiKey"
        android:value="mykey" />

Don't use

<meta-data
        android:name="com.crashlytics.ApiKey"
        android:value="@string/crashlytics_api_key" />
like image 89
grandouassou Avatar answered Sep 22 '22 10:09

grandouassou


I have solved the issue. I had long conversation with crashlytics team, but they didn't helped me.

My solution is to create separate project, and install crashlytics on that project. It will generate api key on that project. I just copied that key and pasted to my original project and it worked. Have no idea why it didn't generated the key on my initial project.

like image 24
Misha Akopov Avatar answered Sep 21 '22 10:09

Misha Akopov