我正在尝试将我的firebase-plugins
依赖项版本升级到支持 Android Gradle 插件版本 3+
的1.1.2
,但 Gradle 构建配置一直失败,除非我使用已弃用的compile
。我使用的是 Play 服务版本 11.4.2
,并且我添加了firebase-perf
依赖项,如下所示,但失败了:
implementation "com.google.firebase:firebase-perf:$playServicesVersion"
修复它的唯一方法是将上述implementation
更改为 compile
.有没有人找到解决这个问题的解决方案?(除了降级到firebase-plugins
版本1.1.0-alpha1
?
下面是错误消息:
* What went wrong:
A problem occurred configuring project ':app'.
> To use the Firebase Performance Plugin, the Firebase Performance Monitoring SDK must be added to the app's build.gradle. Please add compile 'com.google.firebase:f
irebase-perf:VERSION_NUMBER_GREATER_THAN_OR_EQUAL_TO_11.0.4' to the app's build.gradle.
编辑:这已在firebase-plugins:1.1.3
中修复。
此错误是因为 firebase-perf 插件专门查找 com.google.firebase:firebase-perf SDK 的"编译"配置。如果在构建时未将 SDK 包含在 build.gradle 中,则稍后会出现运行时崩溃。
Android Studio 3.0 将"编译"替换为"实现",插件代码应改为检查 firebase-perf SDK 的"实现"配置。
现在的解决方法是继续使用:编译 "com.google.firebase:firebase-perf:$playServicesVersion"
这将在未来的 firebase 插件版本中修复。