简体   繁体   English

Jenkins构建在Crashlytics任务上失败

[英]Jenkins build fails on Crashlytics tasks

I'm new to Jenkins and Build Servers in general. 我是Jenkins和Build Servers的新手。 I am working on setting an Android project up on Jenkins and the app uses Crashlytics. 我正在努力在Jenkins上设置Android项目,该应用程序使用Crashlytics。 Using Gradle, I set my tasks to "clean build", but anytime I hit a Crashlytics task, I get this error: 使用Gradle,我将我的任务设置为“clean build”,但无论何时我遇到Crashlytics任务,我都会收到此错误:

java.lang.Error: Classloader conflict in your Gradle environment, 
please verify you are running the latest Android plugin.

and

Crashlytics data directory at /Users/Shared/Jenkins/Library/Caches/com.crashlytics
could not be created.

I tried setting my Gradle tasks with "-x crashlyticsGenerateResourecesAlpha" (that task that is failing) to skip the task, but that doesn't seem to work either. 我尝试使用“-x crashlyticsGenerateResourecesAlpha”(失败的任务)设置我的Gradle任务以跳过任务,但这似乎也不起作用。

I've checked that I have installed the latest Android tools, emulators, etc. The Android plugins that I currently have downloaded are the Android Emulator Plugin and Gradle plugin (both are the latest releases). 我已经检查过我已经安装了最新的Android工具,模拟器等。我目前下载的Android插件是Android Emulator Plugin和Gradle插件(两者都是最新版本)。 I'm using Git to pull in my project. 我正在使用Git来引入我的项目。 I'm starting an emulator before I build the project. 在构建项目之前,我正在启动模拟器。 I'm pointing to the android-sdk folder within the Jenkins directory. 我指向Jenkins目录中的android-sdk文件夹。 I'm also configured JDK 1.7 and that's pointing to the JDK directory on my local box (I'm running Jenkins locally). 我也配置了JDK 1.7,它指向我本地盒子上的JDK目录(我在本地运行Jenkins)。

Here are the build versions I received when I ran gradle -v : 以下是我运行gradle -v时收到的构建版本:

------------------------------------------------------------
Gradle 1.11
------------------------------------------------------------
Groovy:       1.8.6
Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:          2.2.0
JVM:          1.7.0_55 (Oracle Corporation 24.55-b03)
OS:           Mac OS X 10.9.2 x86_64

Is there something else that could be causing this error? 还有其他可能导致此错误的内容吗? Is there a plugin for Crashlytics I may not be aware of? 我可能没有注意到Crashlytics的插件吗? Also, if there are any Jenkins debug tips that I may not be aware of, please let me know and I'll update the question with what I find. 另外,如果有任何我可能不知道的Jenkins调试技巧,请告诉我,我会用我发现的内容更新问题。

I had the same error, because the /Users/Shared/Jenkins/Library directory doesn't exist. 我有同样的错误,因为/Users/Shared/Jenkins/Library目录不存在。 If you create that directory and /Users/Shared/Jenkins/Library/Caches , the crashlytics tasks should complete. 如果您创建该目录和/Users/Shared/Jenkins/Library/Caches ,则应完成crashlytics任务。

These are the final commands that you need to follow: 这些是您需要遵循的最终命令:

sudo mkdir -p /Users/Shared/Jenkins/Library/Caches/com.crashlytics
sudo chown jenkins:jenkins /Users/Shared/Jenkins/Library -R

Here is the relavant debug log for this case: 以下是此案例的相关调试日志:

13:33:45.133 [ERROR] [org.gradle.BuildExceptionReporter]    at com.crashlytics.tools.gradle.CrashlyticsPlugin.<clinit>(CrashlyticsPlugin.groovy:13)
13:33:45.135 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:48)
13:33:45.136 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginRegistry.loadPlugin(DefaultPluginRegistry.java:69)
13:33:45.136 [ERROR] [org.gradle.BuildExceptionReporter]    ... 55 more
13:33:45.141 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.RuntimeException: Crashlytics data directory at /Users/Shared/Jenkins/Library/Caches/com.crashlytics could not be created.
13:33:45.142 [ERROR] [org.gradle.BuildExceptionReporter]    at com.crashlytics.tools.android.DeveloperTools.<clinit>(DeveloperTools.java:116)
13:33:45.143 [ERROR] [org.gradle.BuildExceptionReporter]    ... 60 more
13:33:45.143 [ERROR] [org.gradle.BuildExceptionReporter] 
13:33:45.144 [LIFECYCLE] [org.gradle.BuildResultLogger] 
13:33:45.145 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
13:33:45.146 [LIFECYCLE] [org.gradle.BuildResultLogger] 
13:33:45.147 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 8.362 secs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM