Search code examples
androidfirebase-performance

Firebase Performance Beta / Plugin build issue


When integrating the current Android Firebase Performance Monitoring (beta) version released during I/O 2017 as follows...

Add to project build.gradle:

dependencies {
    classpath 'com.google.firebase:firebase-plugins:1.1.0'
}

Add to app build.gradle:

dependencies {
    compile 'com.google.firebase:firebase-perf:10.2.6'
}

You may come across the following build error.

Error:Execution failed for task ':app:packageDebug'.
> com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;

This is caused by a Guava dependency mismatch, which can be resolved as follows, by modifying the project build.gradle as follows:

dependencies {
    classpath ('com.google.firebase:firebase-plugins:1.1.0') {
                exclude group: 'com.google.guava', module: 'guava-jdk5'
            }
    }

The Firebase team are aware of this issue, suggested the above workaround and will be fixing in a future release.

Putting this out there to help anyone else scratching their head.


Solution

  • This issue was fixed in version 1.1.1 of firebase plugins. To use the updated version just update your project-level build.gradle file as follows:

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath ('com.google.firebase:firebase-plugins:1.1.1')
        }
    }