Fabric插件与Gradle 4.4 +不兼容 [英] Fabric plugin incompatible with Gradle 4.4 +
问题描述
最近,我不得不更新我的项目以使用4.1版的Gradle 4.4。
即
Recently I have had to update my project to use Gradle 4.4 from 4.1. i.e.
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
在我的gradle-wrapper.properties文件中。
in my gradle-wrapper.properties file.
但是,这与结构插件不兼容
However, this is incompabitble with the fabric plugin
apply plugin: 'io.fabric'
自gradle更新以来,我现在在同步项目时遇到构建错误。
例如:
As since the gradle update, I now get build errors when syncing my project. Such as:
错误:无法获取任务
':Module:generateVariantFlavorRFile的未知属性'manifestFile' ',类型为
com.android.build.gradle.internal.res.GenerateLibraryRFileTask。
Error:Could not get unknown property 'manifestFile' for task ':Module:generateVariantFlavorRFile' of type com.android.build.gradle.internal.res.GenerateLibraryRFileTask.
有人知道吗什么时候/是否将有一个与gradle 4.4+兼容的新插件更新?
推荐答案
所以我的项目包括功能模块,在基本模块的 build.gradle
中,我应用了fabric插件。即 apply plugin:'io.fabric'
So my project included feature modules, where in the the base module's build.gradle
, I apply the fabric plugin. i.e. apply plugin: 'io.fabric'
事实证明gradle版本4.4确实可以工作,但您需要添加以下内容:
It turns out that gradle version 4.4 + does work but you need to add the following:
crashlytics { instantAppSupport true }
在基本模块的build.gradle中。我实际上没有即时应用程序,但是即使出现功能模块,也需要此行。
in your base module's build.gradle. I didn't actually have an instant app, but even with feature modules in appears that this line is needed.
有关如何添加此功能的更多信息,请参见此处:
如何将Crashlytics与Android Instant Apps集成?
More info on how this can be added can be found here: How do I integrate Crashlytics with Android Instant Apps?
这篇关于Fabric插件与Gradle 4.4 +不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!