firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

Firebase Perf Instrumentation breaks JaCoCo reporting

Open boswelja opened this issue 3 years ago • 2 comments

  • 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

boswelja avatar Jul 27 '22 21:07 boswelja

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.

raymondlam avatar Jul 29 '22 00:07 raymondlam

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.

Andrew0000 avatar Sep 05 '22 14:09 Andrew0000

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.

dustinlewis avatar Oct 08 '22 20:10 dustinlewis

Thanks for reporting! The AGP is looking into the issue and I'll post an update once they have a fix.

raymondlam avatar Oct 14 '22 21:10 raymondlam

any update?

abhimaandunzo avatar Nov 14 '22 13:11 abhimaandunzo

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.

raymondlam avatar Nov 15 '22 17:11 raymondlam

Marking this as closed since the new update should be working. Marking this as FIXED.

visumickey avatar Mar 24 '23 19:03 visumickey