firebase-android-sdk
firebase-android-sdk copied to clipboard
Firebase Perf Instrumentation breaks JaCoCo reporting
- Android Studio version: 2021.2.1 Patch 1 -
- Firebase Component: Performance
- Component version: 1.4.1
Describe the problem
When applying the Firebase Performance plugin to a module, JaCoCo test coverage reports break and show 5) coverage for everything in that module. This can be resolved by disabling instrumentation as here https://firebase.google.com/docs/perf-mon/disable-sdk?platform=android#extension-property-flag
Disabling instrumentation resolves the issue
Hi @boswelja, thanks for reporting the issue! I was able to create a test project and replicate the issue on my end as well.
I suspect that it is due to both Fireperf and Jacoco instrumenting the code. I'll open up a ticket to the team to see if there is a good way to remedy this.
For now, I think the best action is to disable instrumentation for debug as you mentioned.
Same issue after migrating from firebase 1.3.5.
com.google.firebase:perf-plugin:1.4.1 JaCoCo 0.8.8 JaCoCo shows 0% coverage in the gradle module with firebase perf.
I am experiencing this with a project I am working on as well. It may be worth noting that JaCoCo and Firebase Performance Monitoring were playing nice together with prior versions of AGP / Gradle. We did not start seeing this problem until we updated AGP from 7.1.3 to 7.2+ (and Gradle from 7.2 to 7.3+). Before that, we had both JaCoCo coverage reports working and Firebase Performance Monitoring.
Thanks for reporting! The AGP is looking into the issue and I'll post an update once they have a fix.
any update?
Hi, @abhimaandunzo, I got an update from the AGP team that this is fixed in AGP 8.0 where they removed the old transform API. The JaCoCo code coverage reports should be working again in that version.
Marking this as closed since the new update should be working. Marking this as FIXED.