Search Issue Tracker
Fixed in 2019.3.X
Fixed in 2019.2.X
Votes
1
Found in
2018.3.0a1
2018.3.6f1
2019.1.0a1
2019.2.0a1
Issue ID
1130193
Regression
No
[UWP] await on UI thread continues on a background thread on IL2CPP scripting backend
Steps to reproduce:
1. Download attached project
2. Build a UWP player (IL2CPP, x64, Debug)
3. When app launches click the button to open UWP pop up
4. Close pop up
Expected results: Second UWP pop up shows up
Actual results: Player crashes. In 2018.3.13f and 2017.4 app doesn't crash, but the second pop up doesn't show up
Reproduced with: 2019.2.0a6, 2019.1.0a5, 2018.3.7f1, 2017.4.21f1
Assertion failed on expression: 'CurrentThreadIsMainThread()'
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)
System.UnhandledExceptionEventHandler:Invoke(Object, UnhandledExceptionEventArgs)
Note:
- not reproducible on .NET
Workaround: after await, use UnityEngine.WSA.Application.InvokeOnUIThread() to get back onto the UI thread. Like so:
MessageDialog dialog1 = new MessageDialog("Dialog #1");
await dialog1.ShowAsync();
UnityEngine.WSA.Application.InvokeOnUIThread(async () =>
{
MessageDialog dialog2 = new MessageDialog("Dialog #2");
await dialog2.ShowAsync();
}, false);
Comments (1)
-
seven_
Mar 07, 2019 10:52
We are seeing similar crashes directly after this output in the debug version:
Assertion failed on expression: 'CurrentThreadIsMainThread()'
Assertion failed on expression: 'g_ThreadedGfxDevice'We do not open a dialog though. The Unity player crashes shortly after starting up startup on some (rather older) devices.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- GfxDevice::UpdateBufferRanges when running UIBuilder tests
- [Android][BiRP] Depth processing is handled incorrectly on certain Android devices when using 2 camera's
- [APV] Cancelling Display Dialog Error is thrown after Adaptive Probe Volumes tab is open in Lighting Window
- [APV] NullReferenceException is thrown when baking Adaptive Probe Volume for a Terrain with Non-GI Contributing Tree Prototypes and multiple APV objects with different LayerMasks are present on the scene
- Hands are not recognized when using Hololens 2
Resolution Note (fix version 2019.3):
Fixed in: 2019.3.0a7, 2019.2.0b7