[英]Android Jenkins build fails with crashlytics
Everytime I try to build using Jenkins I get the following error 每次我尝试使用Jenkins构建时,都会出现以下错误
Failed to apply plugin [id 'io.fabric'] Could not create plugin of type 'CrashlyticsPlugin'.
无法应用插件[id'io.fabric']无法创建“CrashlyticsPlugin”类型的插件。
Removing Crashlytics from Gradle fixes this issue 从Gradle中删除Crashlytics可以解决此问题
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
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 所以我想我通过使用这个答案的组合修复它https://stackoverflow.com/a/23944306/3945542与@TarahWheelerVanVlack回答我必须创建两个新的文件夹
/Users/Shared/Jenkins/Library /Users/Shared/Jenkins/Library/Caches / Users / Shared / Jenkins / Library / Users / Shared / Jenkins / Library / Caches
And then make sure they had the proper permissions 然后确保他们拥有适当的权限
I've had this problem before and it was a permissions error. 我之前遇到过这个问题,这是一个权限错误。 Try checking permissions and the user who owns the plugins directory.
尝试检查权限和拥有plugins目录的用户。 If it's not the Jenkins user (if you've created one), then that's the issue.
如果不是Jenkins用户(如果你创建了一个),那就是问题所在。
Create directory /Users/Shared/Jenkins/Home/Library/Caches
创建目录
/Users/Shared/Jenkins/Home/Library/Caches
If you run ./gradlew clean --stacktrace
from the job workspace /Users/Shared/Jenkins/Home/jobs/<job-name>/workspace
you get the following stacktrace 如果从作业工作区
/Users/Shared/Jenkins/Home/jobs/<job-name>/workspace
运行./gradlew clean --stacktrace
,您将获得以下堆栈跟踪
Caused by: java.lang.RuntimeException: Crashlytics data directory at >/Users/Shared/Jenkins/Home/Library/Caches/com.crashlytics could not be created.
引起:java.lang.RuntimeException:无法创建> /Users/Shared/Jenkins/Home/Library/Caches/com.crashlytics中的Crashlytics数据目录。 at com.crashlytics.tools.android.DeveloperTools.(DeveloperTools.java:116) ... 53 more
在com.crashlytics.tools.android.DeveloperTools。(DeveloperTools.java:116)... 53更多
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.