22

Trying to add Twitter Fabric SDK. I have added all dependencies suggested by Twitter.

Modified my build.gradle:

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/repo' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.13.3'
        // The Fabric Gradle plugin uses an open ended version to
        // react quickly to Android tooling updates
       classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.application'

//Put Fabric plugin after Android plugin
apply plugin: 'io.fabric'

repositories {
    jcenter()
    maven { url 'https://maven.fabric.io/repo' }
}

When tries to synch got this error:

Error:Execution failed for task
    ':app:fabricGenerateResourcesDebug'. > Crashlytics Developer Tools error.

While project was build successful before modifying build.gradle file for Twitter SDK.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
kj007
  • 6,073
  • 4
  • 29
  • 47
  • 2
    I've got the same problem, please see my solution: http://stackoverflow.com/questions/28891325/unable-to-build-android-app-fabricgenerateresourcesdebug/28904536#28904536 – Max Lee Mar 06 '15 at 17:46
  • http://stackoverflow.com/questions/28255757/errorgradle-execution-failed-for-task-appcrashlyticscleanupresourcesdebug this solution solved my problem – Adeel Turk Nov 25 '15 at 11:42

3 Answers3

15

You need to add your API Key to the Android Manifest:

<application>
    <meta-data
        android:name="com.crashlytics.ApiKey"
        android:value="your key here" />
</application>

Same solution is provided here.

Community
  • 1
  • 1
krishna5688
  • 1,130
  • 1
  • 11
  • 19
8

Try the next solution:

  1. Open your fabric plug-in and then open Crashlytics
  2. If you don't have install Crashlytics install it. This will modify and sync your build.gradle

I did this and it worked for me. Hope it work for you.

Tomasz Jakub Rup
  • 10,502
  • 7
  • 48
  • 49
4

I got this error after linking my fabric API key to a string resource like so:

<meta-data
    android:name="io.fabric.ApiKey"
    android:value="@string/fabric_api_key" />

Solved it by putting the API key as a string literal in the value attribute:

<meta-data
    android:name="io.fabric.ApiKey"
    android:value="123905329fakekey023904909423" />
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Braden Holt
  • 1,544
  • 1
  • 18
  • 32
  • This is the way Fabric sets your app up by default, but this way is insecure. Someone could decompile your application and see they API key. It is better to have it stored in the gradle.properties file but fabric is giving me this same error when attempting to store it in this manner. – BinaryWave Sep 25 '17 at 05:39
  • Hmm could something like ProGuard be a temporary solution? Source: https://stackoverflow.com/a/14572051/5443056 – Braden Holt Sep 25 '17 at 15:21