Maxwell
Maxwell

Reputation: 6822

Jenkins build fails on Crashlytics tasks

I'm new to Jenkins and Build Servers in general. I am working on setting an Android project up on Jenkins and the app uses Crashlytics. Using Gradle, I set my tasks to "clean build", but anytime I hit a Crashlytics task, I get this error:

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.

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). I'm using Git to pull in my project. I'm starting an emulator before I build the project. I'm pointing to the android-sdk folder within the Jenkins directory. I'm also configured JDK 1.7 and that's pointing to the JDK directory on my local box (I'm running Jenkins locally).

Here are the build versions I received when I ran 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? 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.

Upvotes: 3

Views: 3717

Answers (2)

Shubham Chaudhary
Shubham Chaudhary

Reputation: 51083

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

Upvotes: 4

Christopher Pickslay
Christopher Pickslay

Reputation: 17772

I had the same error, because the /Users/Shared/Jenkins/Library directory doesn't exist. If you create that directory and /Users/Shared/Jenkins/Library/Caches, the crashlytics tasks should complete.

Upvotes: 10

Related Questions