Skip to content

fix: Gracefully handle missing native SDK on consoles#2516

Closed
bitsandfoxes wants to merge 3 commits intomainfrom
fix/graceful-native-console-handling
Closed

fix: Gracefully handle missing native SDK on consoles#2516
bitsandfoxes wants to merge 3 commits intomainfrom
fix/graceful-native-console-handling

Conversation

@bitsandfoxes
Copy link
Contributor

Follow-up on #2503

If there is no console specific lib found, the SDK needs to gracefully degrade as to not break builds.
This is achieved via a unified sentry_native_stubs.c that is getting managed at compile time via the NativePluginBuildPreProcess.cs. This should (tm) work even when installing the package via the package manager due to isOverridable: 1 in the stubs' .meta file.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • Add IThrottler to allow message & stack trace based event throttling by bitsandfoxes in #2479
  • Nintendo Switch native support by bitsandfoxes in #2503

Bug Fixes 🐛

  • Gracefully handle missing native SDK on consoles by bitsandfoxes in #2516
  • Active scene change no longer refreshes trace ID by bitsandfoxes in #2502
  • Specify debug symbol upload files and folders by bitsandfoxes in #2485
  • Check AutoSceneTraces before registering SceneManagerTracingIntegration by bitsandfoxes in #2496
  • Correctly set native SDK name when targeting Android by bitsandfoxes in #2476
  • Set span.origin by bitsandfoxes in #2464

Internal Changes 🔧

Deps

  • Update Cocoa SDK to v9.3.0 by github-actions in #2507
  • Update Native SDK to v0.12.4 by github-actions in #2505
  • Update CLI to v3.1.0 by github-actions in #2474
  • Update Cocoa SDK to v9.2.0 by github-actions in #2492
  • Update Java SDK to v8.31.0 by github-actions in #2493
  • Update Java SDK to v8.30.0 by github-actions in #2481
  • Update Native SDK to v0.12.3 by github-actions in #2471
  • Update Java SDK to v8.29.0 by github-actions in #2462

Release

  • Fix changelog-preview permissions by BYK in #2498
  • Switch from action-prepare-release to Craft by BYK in #2473

Other

  • (repo) Add Claude Code settings with basic permissions by philipphofmann in #2487
  • Use pull_request_target for changelog preview by BYK in #2483

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Fixes

- Gracefully handle missing native SDK on consoles ([#2516](https://github.com/getsentry/sentry-unity/pull/2516))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 0f2f20d

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

public static bool Init(SentryUnityOptions options)
{
_useLibC = Application.platform
_useStructVaList = Application.platform
Copy link

Choose a reason for hiding this comment

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

Xbox/PS5 stubs use wrong DllImport library name

High Severity

When using native stubs (no real sentry library present), Xbox and PS5 builds will fail to link because SentryLib is set to "sentry" but the stub functions are statically compiled into the IL2CPP build and require [DllImport("__Internal")] to be found. Only SENTRY_NATIVE_SWITCH uses "__Internal", but the newly added SENTRY_NATIVE_XBOX and existing SENTRY_NATIVE_PLAYSTATION do not. The P/Invoke calls will look for an external sentry library that doesn't exist in stub mode.

Fix in Cursor Fix in Web

@bitsandfoxes
Copy link
Contributor Author

Well that's a bunch of nonsense.

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.

2 participants