Repository navigation
Done
Labels
Description
The wizard is being ported into the new CLI as sentry wizard (getsentry/toolkit#2528 for Android and Flutter). sentry init stays as a separate command until the two are merged after v4 (toolkit#2510).
This issue tests the Android port. It confirms the gaps already identified, looks for new ones, and plans the follow-ups. Fixing the gaps is not part of this issue. The fixes go into the follow-ups it produces. Same approach as RN-871 for React Native; the earlier action plan is in JAVA-845.
Gaps identified so far
From a code review of the #2528 branch (packages/cli/src/lib/wizard/android/). None of these have been confirmed by running the port yet.
- Only a Logs prompt. Session Replay, User Feedback and profiling are never offered (wizard#829 for profiling).
- A test exception is left in the main Activity, inside
addOnGlobalLayoutListener(templates.ts:55,66), so it fires on every layout pass, not once. - Release builds without a token may fail.
includeSourceContext = trueis still written. In RN-868,sentryUploadSourceBundleReleasefailed without a valid token, even withSENTRY_DISABLE_AUTO_UPLOAD=true. - No version catalog support. The plugin is written as
id("io.sentry.android.gradle") version "…"(gradle.ts:105), never inlibs.versions.toml. - Defaults: the deprecated
io.sentry.send-default-piikey instead of theio.sentry.data-collection.*keys, andtraces.sample-rate = 1.0with no note to lower it for production. - No non-interactive mode. The flow prompts for the module and for Logs.
- The DSN can come from a disabled key: when no key is active, it falls back to
keys[0]. Sentry silently drops events sent with a disabled key (WIZARD-65). - The upload setup is still on CLI 3.x. The port writes
sentry.propertiesfor the Sentry Android Gradle Plugin, which uploads throughsentry-cli, but CLI v4 reads only.sentryclirc. That's on the SAGP side.
Fixed in the port: it uses the first active DSN key.
Not checked yet:
sentry.propertiesis git-ignored. The config setsgitignore: true, but in Re-test:sentry init(CLI 0.49 agent guide) vs@sentry/wizard9.1 across Mobile SDKs (Nov 2026) sentry-react-native#7064 the legacy wizard failed that step at runtime.- The false "Could not add Sentry Gradle plugin" warning on
build.gradle.kts, and the broken<meta-data>indentation (wizard#994, #714). - A main Activity in a library module (wizard#444).
- The failed step is reported (wizard#839, #834).
What must keep working
From the legacy Android wizard, 9.1.0:
- Find the app's
build.gradle/build.gradle.kts, and let the user pick one when there are several. - Add the Sentry Android Gradle Plugin at the latest version, with a
sentry {}block (org, project,includeSourceContext). - Add the manifest
<meta-data>for the DSN, tracing, screenshots and view hierarchy, plus Logs if chosen. - Write the token to
sentry.properties.
Done when
- The
options.setSentryClientNameshould contain the SDK version as well #2528 branch (or the merged port) has been run on fresh Kotlin (Kotlin DSL, version catalog) and Java (Groovy) apps, with Debug and Release builds on an emulator. - Each identified gap is confirmed or ruled out by that run.
- Each "not checked yet" item and each "must keep working" item is marked pass or fail. Each mark says how it was checked: a file check, a build, or an event confirmed in Sentry.
- Any new gaps found in the run are added to the list above.
- Every confirmed gap has a follow-up with an owner. Gaps in the port go on the port PR, or become toolkit issues once it has merged. Gaps on the Android SDK or SAGP side become issues in this project.
Activity
linear-code commentedon Nov 27, 2026
JAVA-857
antonis commentedon Dec 2, 2026
Android wizard: what to fix for it to be usable, by priority
From the first run (toolkit
mainba09503ce, fresh Android Studio AGP 9 projects), updated after the retest onmainaafb1e722 (see the comment below). P0 and P1 were the minimum to call it usable; all of the wizard's part is done.P0: blocks most users
P1: setup breaks or misleads in common situations
./gradlewcheck stops the wizard halfway and blames Sentry (toolkit, regression from 9.1.0). Fixed in fix(cli): Keep the Android wizard going when ./gradlew fails toolkit#2805: it warns, names the JDK mismatch, shows Gradle's own error, continues, and says the verification failed in the outro.sentryUploadSourceBundleReleasefails without credentials, even withSENTRY_DISABLE_AUTO_UPLOAD=true.sentry.propertiesstays on this machine and that CI needsSENTRY_AUTH_TOKEN.P2: works, but not right
id("io.sentry.android.gradle") version "6.28.0"in the app'splugins {}.<meta-data>indentation (toolkit, Sentry Wizard can't work with Android project config file format: build.gradle.kts sentry-wizard#714). Still moves</application>to column 0.io.sentry.send-default-pii(toolkit). Fixed in feat(cli): Write io.sentry.data-collection.user-info in the Android wizard toolkit#2807:io.sentry.data-collection.user-infowhen the added plugin installs SDK 8.58.0+. One edge case below.P3: nice to have
Not checked yet
feat(cli): Write data-collection.user-info in the Android wizard when…
fix(cli): Send the Android wizard's test error once, in debuggable bu…
feat(cli): Ask about tracing and profiling in the Android wizard (get…
fix(cli): Find the Android app module when AGP comes from a version c…
fix(cli): Keep the Android wizard going when ./gradlew fails (getsent…
feat(cli): Write io.sentry.data-collection.user-info in the Android w…
antonis commentedon Dec 3, 2026
Retest:
sentry wizard androidon toolkitmain(aafb1e722, packed npm build 0.52.0-dev.0, not released), 2026-12-03Same setup as the first run:
sentry-sdks/sentry-android, default answers, real org token, JDK 17 unless noted;This time the wizard ran with nobody typing an app path. For the Release checks, I added one handled error per app (
Sentry.captureException(Exception("WizReleaseTest"))inonCreate, TEST ONLY), since the wizard's test error now runs only in debuggable builds.Blockers: none.
sentry.properties: "sentry.properties holds your auth token and is gitignored, so other machines, such as a teammate's clone or CI, don't have it. Release builds there fail at the Sentry upload until a token is available…" plus the settings URL. The outro adds "Release builds on other machines and in CI need SENTRY_AUTH_TOKEN".io.sentry.data-collection.user-infosentry-sdks/android.sentry-sdks/sentry-android, see below.traces.sample-rate,traces.user-interaction.enable,traces.profiling.session-sample-rate = 1.0andtraces.profiling.lifecycle = trace.--no-tracinglogs "Profiling: no (it only runs during traces, so it needs Tracing)" and leaves out the tracing and profiling keys.Still working, end to end
sentry {}, manifest<meta-data>, token in gitignoredsentry.propertiesMainActivity.onCreate,MainActivity.kt:39MainActivity.onCreate,MainActivity.java:36ui.load MainActivityper launchprofiler.id, and the device log shows the SDK writing a Perfetto trace. No profile chunk in the stats yet during the test window.--tracing --logs --profiling --no-mcp < /dev/nullNew, minor
sentry-android(orsentry-android-core,sentry-bom).sdkReadsDataCollectionreads the app's build file after the wizard writessentry { projectName.set("sentry-android") }.SDK_ARTIFACT_NAME_RE(meant for map notation likename: 'sentry-android') matches that quoted project name and counts it as a declared SDK with an unknown version, so the wizard falls back toio.sentry.send-default-pii.androidgetsio.sentry.data-collection.user-info.name:in map notation, or check the build file before thesentry {}block is added.io.sentry.attach-screenshotis on and the snippet now waits for the first layout. Onlyview-hierarchy.jsonis attached.Still open: see the updated checklist above.
<meta-data>indentation.antonis commentedon Dec 3, 2026
Closing: the Android port of
sentry wizardis usable. The retest above found no blockers on fresh Android Studio AGP 9 projects (Kotlin + Compose + Kotlin DSL, and Java + Views + Groovy DSL, both with a version catalog). Release errors arrive symbolicated with source context, tracing and profiling work, and a run without a terminal finishes with exit code 0.Fixed in toolkit after the first run (all merged, confirmed in the retest):
./gradlewfails, shows Gradle's own error, and no longer blames Sentry (P0)SENTRY_AUTH_TOKEN(andSENTRY_URLon self-hosted) (P1)io.sentry.data-collection.user-infoinstead of the deprecatedsend-default-piiwhen the installed SDK reads it--no-mcpanswers the last question, so runs without a terminal can finish with exit code 0 (shared by all wizards)Feature gap closed after the retest:
--replay), whatever the Tracing answer, and writesio.sentry.session-replay.session-sample-rate = 0.1andio.sentry.session-replay.on-error-sample-rate = 1.0to the manifest. Text and images are masked by default.The Android wizard now asks Tracing, Logs, Profiling (only with Tracing) and Session Replay, like the other mobile wizards. Not yet checked in a real app: that a replay is attached to an error.
Known, not blocking:
send-default-piiwhen the Sentry project is named after an SDK artifact (sentry-android,sentry-android-core,sentry-bom): the artifact check also matches theprojectNamethe wizard writes intosentry {}. A small follow-up in toolkit.attach-screenshotis on. Likely because the error is sent after the first layout but before the first draw; to confirm with the Android SDK team.Parked:
--app-moduleflag, for projects with several app modules.id(...) versioninplugins {}.<meta-data>indentation (Sentry Wizard can't work with Android project config file format: build.gradle.kts sentry-wizard#714).