Skip to content

Support disabling Sentry for selected Unity platforms #2796

Description

@821869798

Use case

We install Sentry Unity through OpenUPM and use it on desktop only. Android and iOS use Bugly, so Sentry is not initialized on those platforms.

Runtime guards prevent initialization, but the Sentry assemblies and dependencies can still be included in IL2CPP builds. In our comparison, enabling Sentry increased Managed/IL2CPP VM by about 15.9 MiB. We want to avoid this cost on platforms where Sentry is unused.

Request

Please provide an officially supported way to disable Sentry at compile time for selected Unity build targets, for example:

  • a symbol such as SENTRY_UNITY_DISABLE; or
  • a per-platform option in Sentry Project Settings.

When disabled, Sentry runtime code, native plugins, and managed dependencies should not be included in that player. The package should remain installed and updateable through OpenUPM so Sentry can still be used on desktop without maintaining a fork.

This is related to #2408, but specifically requests a per-platform compile-time opt-out.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Featurenew featureUnityplatform label

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions