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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application gets stuck on splash screen in Release config with MvvmCross 8.0.2 #4364
Comments
I'm also having this issue. I tried finding the issue and removing most packages, in the end it was mostly just MvvmCross that was left. The linker is set to SDK only. but the only build setting that seems to cause the hanging is debugging set to false (MtouchDebug). Reverting back to 7.1.2 did fix the issue. |
Is this something reproducible for you in the Playground.iOS project too? Edit: Nevermind, just noticed that you are writing Release mode. I can reproduce this as well in TipCalc sample. Digging into the issue. |
OK, turned out TipCalc.iOS sample was missing a LinkerPleaseInclude file to hint usage of stuff. To be able to better debug this at your end. You can take a look at the device log with the Console app on your mac with the device attached. Here you should be able to see any exceptions thrown. I need more info to go from to be able to debug your issue. |
mvvmcross8.0.2_freeze_log.txt |
@entdark I guess your App is Ska? It looks like it is running and doing a bunch of network and location calls. No exceptions thrown. You are probably in some kind of dead lock blocking the UI thread so it cannot continue. |
Yes. It is. |
With Mvx 8.0.2, WPF, .NET 5. I'm having a similar problem when trying to publish a message from code called from MvxAppStart.NavigateToFirstViewModel() and the MvxMessenger is getting stuck waiting for the UI Thread. I'm processing the command line args to load a file and navigate to the correct viewmodel, the same code works when selecting a load button after the UI shows. This previously worked with Mvx 7 and lower. |
I've not managed to find out what the difference is between 7 and 8, as the way things get started has changed (sidenote: not a fan of having to use MvxWindow looking for ways to remove that dependency!), but I have found some more info about what is happening. When I load the file I process parts of it with multiple Task.Run() which speeds loading up a great deal, there is a lot of data to process. When I do that the context is no longer the main thread and MvxMessenger.Publish() tries to dispatch back to the main thread. I've verified this by checking Mvx.Resolve<MvvmCross.Base.IMvxMainThreadDispatcher>().IsOnMainThread at various breakpoints. If I remove all the Task.Run()s then the application runs, but processing the file is very slow, and I do not get any process updates. The question is why is MvxMessenger deadlocking from an awaited load method from the MvxAppStart.NavigateToFirstViewModel() but not from other locations like an async command aka button click which is also on the main thread? For now, I'm going to try using an interim "loading" viewmodel to load the data and navigate to the landing viewmodel and see if that works. |
I think you (and/or me) could try to add MvvmCross 8.0.2 projects to your own project and see step by step what's going on. |
I've created a loader viewmodel and moved the load and navigate code to an async method that is invoked from Start() ........and........it works!!!! no deadlocks from MvxMessager even when awaiting the Navigate() from NavigateToFirstViewModel(). |
@Cheesebaron Another issue on iOS in Release. Now it crashes. Try it out yourself: https://github.com/entdark/JKChat/tree/mvvmcross_8.0.2 |
@entdark I'm pretty sure it will work if you down grade Microsoft.Extensions.Logging nuget package from 6.0.0 to 5.0.0. |
Why? |
Downgrading Microsoft.Extensions.Logging to 5.0.0 didn't help. |
Probably can be temporarily solved with this workaround. |
@ivmirx The workaround fixed the issue in both freezing and crashing projects. |
馃悰 Bug Report
Application gets stuck on splash screen.
Expected behavior
Application gets navigated to the first view model.
Reproduction steps
Compile an iOS app with Release | iPhone configuration:
SDK Version: 15.0
Linker behavior: Link Framework SDKs Only
Supported architectures: ARMv7 + ARM64
HttpClient: Managed
Debug information: None
Either publish for TestFlight or locally launch on an iPhone device.
The steps may not work on other projects.
Configuration
Version: 8.0.2
Platform:
Comment
That started after upgrading from 6.4.2 to 8.0.2.
I also cannot debug it since with any debugging option enabled (still in Release configuration) the issue disappears.
When I tried to downgrade to 7.1.2 the issue has gone as well.
I tried to find out the cause of the issue myself and found out that
NavigateToFirstViewModel
never finishes if awaited.If
await
is removed then the app crashes.I could be wrong it's the key of the issue, just the maximum I could find myself.
The text was updated successfully, but these errors were encountered: