-
-
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
Intermittent splash screen hang on Android #286
Comments
Thanks for the details. The logcat logs don't seem to have anything related to Sentry, just google play stuff. How long is the hang for? Does it get stuck on it forever? Or does it eventually go through the splash screen? Did you have a chance to enable Sentry's SDK debug flag? You can do it through the Sentry window: Make sure to unselect: Only In Editor so that the logs also happen in the Android player. |
Hey @adamsoutar! We just released 0.5.0 today that addresses several issues, one of which was code-stripping related and could cause the SDK to fail to initialize at startup. (which would also lead to a lack of logs in logcat) |
Hey, sorry I've not come back to this issue, I've been away for a few days. Looking deeper into the hangs, they do eventually seem to go through. I've recorded the You can see the hang in the timestamps - I opened the app at Currently I have the game open on my Android test phone, and it's been sitting on the splash for >15 minutes. I assume it would eventually go through though. This is why I thought it was an absolute freeze, I just never waited more than a minute on the splash. It seems every splash is delayed a bit by Sentry (they're all noticeably longer than comparable starts on iOS), but some are crazy long. I can also reproduce the issue in Airplane mode (and even airplane mode all the way from boot), which to me suggests the variable hang lengths are not due to waiting on network activity. This issue has me a bit stumped 🤔 |
Based on your description it sounds like the issue is due to the
This is configured via the Sentry Window too: The motivation from this feature, as taken from the docs:
If that value was This feature made more sense when the only envelope item type was of error events. Now that the SDK sends sessions, we should reconsider this. We should write a 'crash' trigger file on disk and only invoke the Flush On Init Blocking call in that case, to avoid any sort of slow down in case the app didn't crash the execution before. Even though this doesn't explain the 2 minute splash screen delay, until we reconsider what triggers the blocking flush on init, we should disable this feature altogether in the Unity SDK. To confirm this could be related to this option, could you set it to |
Thanks for the additional context. It's good to know it's not related to the So seems like something going on with offline caching only, but I can't imagine what would block for such a huge amount of time (as opposed to deadlock, simply never completing loading). It would be great if we a repro so we can debug this here. I haven't experience such case yet on my tests. Would you be able to share a project we can run on our end that (with offline caching enabled) reproduces the issue? Offline caching is not only useful for mobile to capture errors when the devices is not connected to the Internet but also to help track sessions (release health) we can tell if the session exited gracefully or in an abnormal way (and with native support: Crashed free sessions) |
Absolutely. I'll work on trying to produce a reproducible example project. |
Hey, I was able to reproduce the issue very easily - just a blank new project with Sentry added does the trick. Unity 2020.3.12f1: These are just the Unity versions I had lying around installed on my machine. I use 2021.1.17 for my game (the main project I filed this issue for). To make the repros smaller to download, I removed the Just in case you're unable to reproduce, I've uploaded a video of what the issue looks like, and the amount of attempts it sometimes takes (happens at 2 minutes 20 seconds). Hope these help! And thanks for your help so far |
Thank you so much for the video and the repro. We'll definitely take a look at this really soon and get back to you. |
Hi, Thank you, I hope this helps :) |
Thank you again for the repro, clearly it took some effort to do do it. Now through @Tanek81's comment it seem this isn't related to Sentry's SDK (and we couldn't really repro on our end) so I removed the
We did not. But thanks for giving us an update here about it |
We managed to reproduce this and with further investigation from @bitsandfoxes it seems to only happen if Auto Session Tracking is turned on: We only managed to repro after many attempts so it's not very clear yet if this is an SDK bug related to sessions or something with Unity as @Tanek81 experienced. But we'll keep investigating and for the time being we suggest disabling Auto Session Tracking. |
So I've investigated this further but the lack of actual reproducibility makes it really really hard. |
@adamsoutar please let us know if this is still an issue for you. We haven't been able to repro this anymore |
Doesn't seem to be the case that the failing smoke test is due to splashscreen hang up. No more reports of this and no one in the team has experienced this in months. |
Environment
How do you use Sentry?
Sentry SaaS (sentry.io)
Which SDK and version?
Sentry Unity 0.4.3 (
https://github.com/getsentry/unity.git#0.4.3
via UPM)Steps to Reproduce
Result
When running the built Android app, sometimes it will work, but roughly 1 in 10 starts of the app will hang indefinitely on the splash screen. This was a baffling issue, and it is resolved by removing sentry-unity from the project.
Looking at
adb logcat
for one of the hangs, it seems to print this:I wasn't able to make much sense of that, but it does seem to only be printed on the launches that hang. No logs are printed from my C# code on these launches, implying that it hasn't started to properly load the game yet.
The issue is not reproducible on iOS or PC. There isn't a consistent gap between launches that hang - sometimes they're only 1 or 2 apart, sometimes you can go for 10 or more without seeing anything go wrong. I had to sit and open and close the app over and over haha
Potentially useful info
Unity version - 2021.1.17f1
Scripting Backend - IL2CPP
API Compatibility Level - .NET Standard 2.0
C++ Compiler Configuration - Master
Please do let me know if there's any other info that would be helpful for debugging this issue - I'd love to be able to use Sentry in my project.
I might come back and attach a reproducible example project if I have the time this weekend.
The text was updated successfully, but these errors were encountered: