Skip to content
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

Debug Symbols not being uploaded for Android builds #1696

Closed
emrys90 opened this issue Jun 19, 2024 · 12 comments · Fixed by #1698
Closed

Debug Symbols not being uploaded for Android builds #1696

emrys90 opened this issue Jun 19, 2024 · 12 comments · Fixed by #1698
Assignees

Comments

@emrys90
Copy link

emrys90 commented Jun 19, 2024

Unity 2022.3.31f1
Sentry Unity 2.0.7

So it's like its not even running. I don't see any output logs in the Unity console for it trying to upload, and I've checked in ProjectFolder/Logs and do not see the expected sentry-symbols-upload.log file.

I have verified that the sentryUploadSymbols section of code is being added to the launcher/build.gradle file.

I've tried to find Unity gradle logs or something to try and get additional information, but have been unable to locate them.

I did try an Export Project build and then build the project in Android Studio. This did upload the files (but I had to manually fix the sentry-cli executable path as Android Studio did not like the default path for some reason), so that should confirm that my auth token/etc information is correct. I suspected maybe the cli path was incorrect, but in an non-export build it appears to be pointing to the correct location.

@emrys90
Copy link
Author

emrys90 commented Jun 19, 2024

So as a test I tried an APK build and it did upload. So it appears to not be uploading for App Bundle builds.

@munkiki7
Copy link
Contributor

@emrys90 , thanks for reporting this. We will fix this issue as soon as possible.

@emrys90
Copy link
Author

emrys90 commented Jun 20, 2024

@munkiki7 Thanks for the quick fix! Is there like a beta UPM link I can switch to for testing this, or do I need to wait for the next release?

@munkiki7
Copy link
Contributor

@emrys90 , you have to wait for the next release, but it should come soon.

@emrys90
Copy link
Author

emrys90 commented Jun 21, 2024

I updated to the 2.1.0 update and can confirm that debug symbols are being uploaded for App Bundle builds. However, I'm not getting line numbers in the dashboard for an error. Is there anything else I need to do to get that working?
image

@munkiki7
Copy link
Contributor

munkiki7 commented Jun 21, 2024

@emrys90 , if you are using IL2CPP builds, there is an option in the Sentry Settings to enable IL2CPP line numbers support.
However, it has some limitations, one of them described in this issue: #1509

It's a known limitation, and currently we were not able to solve this issue.

@emrys90
Copy link
Author

emrys90 commented Jun 21, 2024

Is there any way to work around that? Not being able to use it for Debug.LogError is a pretty severe limitation. I do all my logs wrapped in a helper method though so if there's any workarounds I can manage that, ie if I create an exception and log that instead should it work?

@emrys90
Copy link
Author

emrys90 commented Jun 21, 2024

So looking through documentation, and it says you have to call SentrySDK.CaptureException for it to work, Debug.LogException doesn't either?

So I would need to throw instead of log error, catch, and then call SentrySDK.CaptureException? Would that work? If so, how would I also be able to Debug.LogError without it getting passed to Sentry?

@munkiki7
Copy link
Contributor

Yes, you can create an exception and capture it.

As for the other parts of the question - maybe, @bitsandfoxes can clarify those.

@emrys90
Copy link
Author

emrys90 commented Jun 21, 2024

I'm not finding a good way to handle it so far. I still need the Debug.LogError so it'll print to the Unity console and other log handlers, but if I do Debug.LogError and SentrySdk.CaptureException then Sentry will upload two error reports.

I've thought about trying to hook into the before send event to cancel the duplicate out, but can't think of a way yet to know which one to cancel.

Also, haven't tested in build yet to see if its the same, but calling SentrySdk.CaptureException in the editor from a try catch error message exception, shows only the last method in the stack trace. It's not capturing the full stack trace.

@emrys90
Copy link
Author

emrys90 commented Jun 21, 2024

After thinking about it a bit more, I realized its unhandled exceptions where majority of the benefit is for getting line numbers. While it would be nice to have for Debug.LogError as well, its not critical.

I confirmed I am getting line numbers on a Google Play build now for unhandled exceptions, so I'm going to call it good enough and move on.

Thanks for all your help!

@bitsandfoxes
Copy link
Contributor

Thanks for all the feedback. As mentioned above, we're going to have to take apart the logging integration and we're tracking that over here: #1509

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants