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.
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:
SENTRY_UNITY_DISABLE; orWhen 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.