Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Performance Plugin causing slow build time

When using Firebase Performance in Android Studio the gradle task app:transformClassesWithFirebasePerformancePluginForDebug is taking significantly longer than any other task and is therefore dramatically slowing down my gradle build times.

Slow Build shown in Profiler

like image 845
Ian White Avatar asked Nov 19 '17 18:11

Ian White


1 Answers

Firebase in our project caused 40% build time increase. To speed up debug builds we added a possibility to switch it on/off using build parameters in app/build.gradle and root build.gradle files:

app:

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

root/buildscript/dependencies:

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

when running from the command line use

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

when working from Android Studio, add the flag to compiler options:

Android Studio compiler options

like image 64
Ivan Kravchenko Avatar answered Sep 20 '22 16:09

Ivan Kravchenko