Skip to content

build(android): [AGP New DSL 3] Use AGP's new DSL - #6655

Draft
runningcode wants to merge 2 commits into
no/agp-new-dsl-9-builtin-kotlinfrom
no/agp-new-dsl-9-new-dsl
Draft

runningcode wants to merge 2 commits into
no/agp-new-dsl-9-builtin-kotlinfrom
no/agp-new-dsl-9-new-dsl

Conversation

@runningcode

@runningcode runningcode commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (AGP New DSL 9.x.x)


📜 Description

Drops the android.newDsl=false opt-out, so the build runs on AGP's new DSL.

Build-logic and the module build scripts already use only the com.android.build.api DSL and Variant API types. The legacy BaseExtension configuration the issue mentions is gone from the root build, so removing the flag is enough there.

The Android sample cast its variants to AGP's internal VariantImpl to finalize the assemble and install tasks with the native-logging toggle. It now matches those tasks by name, lazily and without afterEvaluate.

💡 Motivation and Context

AGP 10 removes android.newDsl=false.

💚 How did you test it?

  • Checked that the android extension is AGP's new LibraryExtensionImpl, not the legacy BaseExtension, with the flag gone.
  • check on all 13 Android modules and sentry-test-support, the samples build, both Android sample variants, both UI test apps and test-app-size.
  • Published the Android modules with the new and the legacy DSL. The POMs and .module files are byte-identical, and the AARs and jars have the same entries and sizes.
  • toggle<Variant>NativeLogging still finalizes assembleDebug, assembleRelease and installDebug in the sample.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

None.

🤖 Generated with Claude Code

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into 9.x.x.

#skip-changelog

runningcode and others added 2 commits November 18, 2026 10:05
Build-logic and the module build scripts already use only the
com.android.build.api DSL and Variant API types, so dropping the
android.newDsl=false opt-out is enough. The published artifacts are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Finalize the variant's assemble and install tasks by name, so the
sample doesn't depend on a non-stable impl class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 18, 2026

Copy link
Copy Markdown

JAVA-650

@sentry

sentry Bot commented Nov 18, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.64.0 (1) release

⚙️ sentry-android Build Distribution Settings

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant