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
- Add the Sentry React Native Gradle plugin to an Android project.
- Add another plugin that uses the AGP Artifacts API to transform APKs (e.g. FullStory).
- Build a release APK.
- 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/.
Summary
The Sentry React Native Gradle plugin calls
tasks.matching{}.each{}insideandroidComponents.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 expectedbuild/outputs/directory. This breaks any downstream tooling or CI pipelines that depend on APKs being in the standard output location.Steps to Reproduce
build/intermediates/instead ofbuild/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
onVariantsinterferes with the AGP Artifacts API transform chain, causing APKs to be written tobuild/intermediates/instead ofbuild/outputs/.