crashlytics developer tools error when building android -gradle project
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.+'
}
Solution 1:
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:
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:
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:
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:
<meta-data
android:name="com.crashlytics.ApiKey"
android:value="your key" />
I had simillar issue. Just add these line to your Android manifest file.