Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Jenkins build fails with crashlytics

Everytime I try to build using Jenkins I get the following error

Failed to apply plugin [id 'io.fabric'] Could not create plugin of type 'CrashlyticsPlugin'.

Removing Crashlytics from Gradle fixes this issue

like image 267
Brando Madden Avatar asked Dec 30 '14 23:12

Brando Madden


3 Answers

These are the final commands that you need to follow:

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

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
like image 181
Shubham Chaudhary Avatar answered Oct 13 '22 09:10

Shubham Chaudhary


So I think I fixed it by using a combination of this answer https://stackoverflow.com/a/23944306/3945542 with @TarahWheelerVanVlack answer I had to create two new folders

/Users/Shared/Jenkins/Library /Users/Shared/Jenkins/Library/Caches

And then make sure they had the proper permissions

like image 4
Brando Madden Avatar answered Oct 13 '22 11:10

Brando Madden


I've had this problem before and it was a permissions error. Try checking permissions and the user who owns the plugins directory. If it's not the Jenkins user (if you've created one), then that's the issue.

like image 1
Tarah Wheeler Van Vlack Avatar answered Oct 13 '22 11:10

Tarah Wheeler Van Vlack