Skip to content

fix(android): write lowercase booleans to the AndroidManifest - #2846

Merged
bitsandfoxes merged 6 commits into
mainfrom
fix/android-build-time-dsn-validation-
Sep 19, 2026
Merged

bitsandfoxes merged 6 commits into
mainfrom
fix/android-build-time-dsn-validation-

Conversation

@bitsandfoxes

@bitsandfoxes bitsandfoxes commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Resolves #2843
Works around getsentry/sentry-android-gradle-plugin#1454

But is good cleanup, so, here we go.

Comment thread src/Sentry.Unity.Editor/Android/AndroidManifestConfiguration.cs
@bitsandfoxes bitsandfoxes changed the title fix: validate DSN in PostGenerateGradle fix(android): write lowercase booleans to the AndroidManifest Sep 18, 2026
Comment on lines 573 to +576
_ => "debug"
});

// The Sentry Gradle plugin only recognizes lowercase booleans when resolving the metadata at build time.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The check in SetupSymbolsUpload is outdated and doesn't validate the DSN, causing symbol uploads to be configured even when the native SDK is not included.
Severity: MEDIUM

Suggested Fix

Update the conditional check in the SetupSymbolsUpload method to use AndroidSdkEnabled. This property correctly validates that a DSN is present by calling _options.IsValid(), aligning its behavior with other methods like AddAndroidSdkDependencies and ensuring symbol uploads are only configured when the native SDK is properly enabled.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/Sentry.Unity.Editor/Android/AndroidManifestConfiguration.cs#L573-L576

Potential issue: The `SetupSymbolsUpload` method contains an outdated conditional check,
`_options is not { Enabled: true, AndroidNativeSupportEnabled: true }`. Unlike other
related methods that were updated to use `AndroidSdkEnabled` (which validates the DSN
via `_options.IsValid()`), this check does not validate the DSN. As a result, if
`Enabled` and `AndroidNativeSupportEnabled` are true but the DSN is empty, the symbol
upload task will be configured even though the native SDK dependencies are not included
in the build. This creates an inconsistency introduced by the new changes.

@bitsandfoxes
bitsandfoxes merged commit 133307a into main Sep 19, 2026
68 checks passed
@bitsandfoxes
bitsandfoxes deleted the fix/android-build-time-dsn-validation- branch September 19, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash after bumping "io.sentry.unity" from 4.9.0 to 4.10.0

2 participants