每当我尝试使用Jenkins构建时,我都会收到以下错误
无法应用插件[id' io.fabric'] 无法创建类型' CrashlyticsPlugin'。
的插件
从Gradle中删除Crashlytics修复了此问题
答案 0 :(得分:6)
这些是您需要遵循的最终命令:
sudo mkdir -p /Users/Shared/Jenkins/Library/Caches/com.crashlytics
sudo chown -R jenkins:jenkins /Users/Shared/Jenkins/Library
以下是此案例的相关调试日志:
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
答案 1 :(得分:4)
所以我认为我通过将这个答案https://stackoverflow.com/a/23944306/3945542和@TarahWheelerVanVlack结合使用来修复它,我必须创建两个新文件夹
/用户/共享/詹金斯/库 /用户/共享/詹金斯/库/缓存
然后确保他们拥有适当的权限
答案 2 :(得分:1)
之前我遇到过这个问题,这是一个权限错误。尝试检查权限和拥有plugins目录的用户。如果它不是Jenkins用户(如果你创建了一个),那就是问题。
答案 3 :(得分:1)
创建目录
/Users/Shared/Jenkins/Home/Library/Caches
如果从作业工作区./gradlew clean --stacktrace
运行/Users/Shared/Jenkins/Home/jobs/<job-name>/workspace
,您将获得以下堆栈跟踪
引起:java.lang.RuntimeException:无法创建&gt; /Users/Shared/Jenkins/Home/Library/Caches/com.crashlytics中的Crashlytics数据目录。 在com.crashlytics.tools.android.DeveloperTools。(DeveloperTools.java:116) ... 53更多