-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Unity as a Library does not report crashes/fatals #1727
Comments
Thanks @Esildor for reaching out! Tbh I've never tried the UaaL sample. I'll get back to you after giving this a try! |
This has not been forgotten. I'm working my way through the guide. |
Thanks for the update 💖 |
We're working on, well, making that work. There are a couple of questions that need to be answered first:
|
I've created a UaaL repro here to have something to work off of. |
ContextWhen exporting as a library Unity we have a couple of different things to watch out for:
Setup for Automatic Native Crash CaptureNumber 3 is currently the crux. When exporting as a library, Unity has its own activity to run in
To get the Android SDK to have the NDK integration running in the separate process we have to follow our "multi process apps" docs and add
to the GotchaAdd ResultHaving followed this setup native crashes do automatically get captured. Open IssuesThere are a couple issues remaining, mostly debug symbols and IL2CPP related. Debug Symbol UploadThe debug symbols automatically uploaded by the Android Gradle Plugin seem to be lacking the C# line numbers and IL2CPP MappingsBecause native support during the export is disabled we also don't generate and upload the IL2CPP mappings errors captured by the Unity SDK are missing line numbers. but this can be fixed on the SDK side. C# frames in native crashesThe screenshots of native crashes have a couple of
TLDR; What to do?
|
Step by step guide to capture native crashes via the surrounding Android SDK - NO Sentry Unity SDK1. Export the Unity project.You don't need the Unity SDK at this point. 2. Run the wizard out the outputted Android project.I chose
and here, adding the sentry-cli options. The wizard will also add the options to the 3. Add a custom
|
Adding capturing of C# errors - Adding the Unity SDKTo capture in-game C# errors and have the proper support for Unity specific contexts you need to add the Sentry SDK for Unity. This will also enable IL2CPP line number support, giving you actual C# line numbers instead of the generated C++ ones. Disable Android Native SupportTo avoid dependency conflicts, since the SDK for Android will already be in the app, you need to opt-out of the Android Native Support in the Unity SDK. Update the
|
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
UnityEngine.Diagnostics.Utils.ForceCrash()
. To the top left of the screen.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
The text was updated successfully, but these errors were encountered: