构建 android -gradle 项目时 crashlytics 开发人员工具错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25060008/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
crashlytics developer tools error when building android -gradle project
提问by user2469133
I'm trying to build an android gradle project using eclipse, but i get this error when building the project using the command line:
我正在尝试使用 eclipse 构建一个 android gradle 项目,但是在使用命令行构建项目时出现此错误:
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
我正在使用 gradle 1.10 版也尝试过 gradle 1.12 版但我得到了同样的错误
and here is my build.gradle file :
这是我的 build.gradle 文件:
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.+'
}
回答by Antonio Jose
Had a similar error trying to use Fabric's Twitter Kit
尝试使用 Fabric 的 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.
错误 - Crashlytics 开发人员工具错误。java.lang.IllegalArgumentException:Crashlytics 发现无效的 API 密钥:XXXXXXXXX。检查 Crashlytics 插件以确保已成功添加应用程序!联系 [email protected] 寻求帮助。
After login in Fabric, download the AndroidStudio plugin and let it configure everything all worked fine.
登录Fabric 后,下载 AndroidStudio 插件并让它配置一切正常。
(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
编辑:它也可以在不安装 AndroidStudio 插件的情况下完成。按照 Fabric 站点https://fabric.io/downloads/gradle 中的这些说明进行操作
回答by David Argyle Thacker
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 Setupyou might have included the following code
这不是原始问题的解决方案,但您也可以通过其他方式遇到此错误。如果您正在关注Gradle 高级设置的文档,您可能已经包含以下代码
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.
现在,如果您正在测试您的应用程序,您可能已经尝试进行设置ext.enableCrashlytics = true
。显然,这会导致 Crashlytics 出现错误,并且不是该变量的有效值。
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.
因此,如果您希望为调试版本启用 Crashlytics,则需要在测试时注释掉这一行或将其完全删除。
回答by Zahid Ali
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
我解决了这个问题
回答by Alan Zhiliang Feng
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:
我通过在 AndroidManifest.xml 中用“com.crashlytics.ApiKey”替换“io.fabric.ApiKey”来解决这个问题(我不喜欢改变 Crashlytics 库)。所以最后一个是:
<meta-data
android:name="com.crashlytics.ApiKey"
android:value="xxxxxxxx" />
回答by prsandroid
<meta-data
android:name="com.crashlytics.ApiKey"
android:value="your key" />
I had simillar issue. Just add these line to your Android manifest file.
我有类似的问题。只需将这些行添加到您的 Android 清单文件中即可。
回答by Shubham Gupta
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.
基本上,我试图使用@string/crashlytics_key_prod,而不是输入实际的密钥。
Replacing "@string/crashlytics_key_prod" by the actual key in the manifest resolved this issue for me.
用清单中的实际键替换“@string/crashlytics_key_prod”为我解决了这个问题。