getsentry / sentry-unity

Development of Sentry SDK for Unity
https://docs.sentry.io/platforms/unity/
MIT License
204 stars 51 forks source link

Using Unity as a Library does not report crashes/fatals #1727

Open Esildor opened 1 month ago

Esildor commented 1 month ago

Environment

How do you use Sentry? Sentry SaaS

Which version of the SDK? 2.1.0

How did you install the package? Git-URL

Which version of Unity? 6000.0.4f1

Is this happening in Unity (editor) or on a player like Android, iOS, Windows? Android

Steps to Reproduce

  1. Download and open the Unity as a Library (UaaL) example.
  2. Install Sentry as a package.
  3. Run the setup wizard to ensure the Sentry plugin is activated.
  4. Ensure that Android Native Support is enabled.
  5. Add this script this script to the project. This will add buttons to simulate various crashes via UnityEngine.Diagnostics.Utils.ForceCrash(). To the top left of the screen.
  6. Continue setting up the UaaL project per the instructions in Unity's Github docs
  7. Build and run on a device
  8. Press any of the ForcedCrashCategory buttons, for example: Engine Crash - FatalError, Engine Crash - AccessViolation, etc.

Expected Result

Unity engine-level crashes/fatal issues are reported to Sentry.

Actual Result

No fatal crash is reported. It's also worth noting: Performing these steps in a non-UaaL project reports fatal level crashes to Sentry as expected, see the image below.

Any logs or screenshots

image

bitsandfoxes commented 1 month ago

Thanks @Esildor for reaching out! Tbh I've never tried the UaaL sample. I'll get back to you after giving this a try!

bitsandfoxes commented 1 month ago

This has not been forgotten. I'm working my way through the guide.

Esildor commented 1 month ago

Thanks for the update 💖