Skip to content

sentry.gradle task realization in onVariants breaks AGP Artifacts API transform chain #5698

@antonis

Description

@antonis

Summary

The Sentry React Native Gradle plugin calls tasks.matching{}.each{} inside androidComponents.onVariants(), which forces task realization during AGP's variant configuration phase. This disrupts the AGP Artifacts API transform chain used by other plugins.

Impact

When the Sentry plugin is used alongside another plugin that relies on the AGP Artifacts API (e.g. FullStory), APK transforms from those plugins output to build/intermediates/ instead of the expected build/outputs/ directory. This breaks any downstream tooling or CI pipelines that depend on APKs being in the standard output location.

Steps to Reproduce

  1. Add the Sentry React Native Gradle plugin to an Android project.
  2. Add another plugin that uses the AGP Artifacts API to transform APKs (e.g. FullStory).
  3. Build a release APK.
  4. Observe that the APK is placed in build/intermediates/ instead of build/outputs/.

Expected Behavior

APKs produced by other plugins' Artifacts API transforms should be output to build/outputs/, regardless of which other Gradle plugins are applied.

Actual Behavior

The Sentry plugin's eager task realization inside onVariants interferes with the AGP Artifacts API transform chain, causing APKs to be written to build/intermediates/ instead of build/outputs/.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions