crashlytics developer tools error when building android -gradle project

AndroidGradleCrashlytics

Android Problem Overview


I'm trying to build an android gradle project using eclipse, but i get this error when building the project using the command line:

 FAILURE: Build failed with an exception.

 * What went wrong:
 Execution failed for task ':app:crashlyticsCleanupResourcesRelease'.
 > Crashlytics Developer Tools error.

 * Try:
 Run with --stacktrace option to get the stack trace. Run with --info or --debug
 option to get more log output.

 BUILD FAILED

I'm using gradle version 1.10 also tried gradle version 1.12 but i get the same error

and here is my build.gradle file :

		buildscript {
			repositories {
				mavenCentral()
				maven { url 'http://download.crashlytics.com/maven' }
			}
			dependencies {
				classpath 'com.android.tools.build:gradle:0.12.+'
				classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
				classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.+'
			}
		}
		apply plugin: 'android-sdk-manager'
		apply plugin: 'android'
		apply plugin: 'crashlytics'

		repositories {
			mavenCentral()
			maven { url 'http://download.crashlytics.com/maven' }
		}

		android {
			compileSdkVersion 19
			buildToolsVersion "19.1.0"
			lintOptions.checkReleaseBuilds false

			defaultConfig {
				minSdkVersion 7
				targetSdkVersion 19
			}

			signingConfigs {
				release {
					storeFile file(STORE_FILE)
					storePassword STORE_PASSWORD
					keyAlias KEY_ALIAS
					keyPassword KEY_PASSWORD
				}
			}

			buildTypes {
			  debug {
			   
			   ext.enableCrashlytics = false
			   buildConfigField "boolean", "LOG_CRASHES", "false"
			  }

			  release {
				 buildConfigField "boolean", "LOG_CRASHES", "true"
				 runProguard true
				 proguardFile 'proguard.cfg'
				 signingConfig signingConfigs.release
			  }
			}
		}

		dependencies {
			compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
			compile 'com.android.support:support-v4:19.1.0'
			compile 'com.crashlytics.android:crashlytics:1.+'
		}

Android Solutions


Solution 1 - Android

Had a similar error trying to use Fabric's Twitter Kit

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

Detailed error > ERROR - Crashlytics Developer Tools error. java.lang.IllegalArgumentException: Crashlytics found an invalid API key: XXXXXXXXX. Check the Crashlytics plugin to make sure that the application has been added successfully! Contact [email protected] for assistance.

After login in Fabric, download the AndroidStudio plugin and let it configure everything all worked fine.

(Btw, I really don't like this setup flow)

EDIT: It also can be done without install the AndroidStudio plugin. Follow these instructions from the Fabric site https://fabric.io/downloads/gradle

Solution 2 - Android

This is not a solution to the original question, but you can also run into this error another way. If you are following docs for the Gradle Advanced Setup you might have included the following code

debug {
    ext.enableCrashlytics = false
}

Now if you are testing your application you may have tried to set ext.enableCrashlytics = true instead. Apparently this will cause errors for Crashlytics though and is not a valid value for this variable.

So if you want Crashlytics enabled for debug builds you'll need to comment out this line while you are testing or remove it altogether.

Solution 3 - Android

By adding this line to your Application's Manifest inside tag

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

I resolved this issue

Solution 4 - Android

I fixed this issue by replacing "io.fabric.ApiKey" with "com.crashlytics.ApiKey" in AndroidManifest.xml (I don't like to change the Crashlytics lib). So the final one is:

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

Solution 5 - Android

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

I had simillar issue. Just add these line to your Android manifest file.

Solution 6 - Android

So I was having this issue and resolved it.

Basically, I was trying to use @string/crashlytics_key_prod, instead of putting in the actual key.

Replacing "@string/crashlytics_key_prod" by the actual key in the manifest resolved this issue for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser2469133View Question on Stackoverflow
Solution 1 - AndroidAntonio JoseView Answer on Stackoverflow
Solution 2 - AndroidAndrea ThackerView Answer on Stackoverflow
Solution 3 - AndroidZahid AliView Answer on Stackoverflow
Solution 4 - AndroidAlan Zhiliang FengView Answer on Stackoverflow
Solution 5 - AndroidprsandroidView Answer on Stackoverflow
Solution 6 - AndroidShubham GuptaView Answer on Stackoverflow