gpt4 book ai didi

java - Firebase 性能插件导致构建时间缓慢

转载 作者:IT老高 更新时间:2023-10-28 20:55:19 26 4
gpt4 key购买 nike

在 Android Studio 中使用 Firebase 性能时,gradle 任务 app:transformClassesWithFirebasePerformancePluginForDebug 花费的时间比任何其他任务都要长,因此大大减慢了我的 gradle 构建时间。

Slow Build shown in Profiler

最佳答案

我们项目中的 Firebase 导致构建时间增加了 40%。为了加快调试构建,我们添加了使用 app/build.gradle 和根 build.gradle 文件中的构建参数打开/关闭它的可能性:

应用程序:

if (!project.hasProperty("disable-performance-plugin"))  {
apply plugin: 'com.google.firebase.firebase-perf'
}

root/buildscript/依赖项:

if (!project.hasProperty("disable-performance-plugin")) {
classpath('com.google.firebase:firebase-plugins:1.1.5') {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
}

从命令行运行时使用

./gradlew your-task  -Pdisable-performance-plugin

在 Android Studio 中工作时,将标志添加到编译器选项:

Android Studio compiler options

关于java - Firebase 性能插件导致构建时间缓慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47380524/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com