Test the `sentry wizard` Android port

未关闭
#6,797 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@antonis 已经在做这个了。

开始于 2026年11月27日。

评估

这个 Issue 还没有评估数据。

描述

Platform: Java

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.

  1. Only a Logs prompt. Session Replay, User Feedback and profiling are never offered (wizard#829 for profiling).
  2. A test exception is left in the main Activity, inside addOnGlobalLayoutListener (templates.ts:55,66), so it fires on every layout pass, not once.
  3. Release builds without a token may fail. includeSourceContext = true is still written. In RN-868, sentryUploadSourceBundleRelease failed without a valid token, even with SENTRY_DISABLE_AUTO_UPLOAD=true.
  4. No version catalog support. The plugin is written as id("io.sentry.android.gradle") version "…" (gradle.ts:105), never in libs.versions.toml.
  5. Defaults: the deprecated io.sentry.send-default-pii key instead of the io.sentry.data-collection.* keys, and traces.sample-rate = 1.0 with no note to lower it for production.
  6. No non-interactive mode. The flow prompts for the module and for Logs.
  7. 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).
  8. The upload setup is still on CLI 3.x. The port writes sentry.properties for the Sentry Android Gradle Plugin, which uploads through sentry-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.properties is git-ignored. The config sets gitignore: true, but in getsentry/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 #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.
主要语言
Kotlin
星标
1.4k
派生
483
平均合并
2 天 54 分钟
30 天内合并 PR
207

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/sentry-java 的其他 Issue

查看 getsentry/sentry-java 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。