-
Notifications
You must be signed in to change notification settings - Fork 36
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
Flutter windows app crashes randomly on start #46
Comments
Sadly I don't have time to work on this now, but just out of interest, is this Windows 11? |
Windows 10 |
Hello!
I can also provide a minidump if necessary. Please let me know how I can assist further. :) |
It's a shame the "Function" column is empty for the plugin stack frames, that would definitely help a lot. Does your minidump contain any information about that? |
I've never used minidump before today, so I'm not sure if I'm using it correctly. I also generated a pdb file (though I'm uncertain if I did it correctly as well) and injected it into WinDbg. Here's the stack trace I obtained:
Minidump attached |
I got this when I run my app on Windows after importing nsd package
|
@gomaze0906 ok that might actually help, I'll at least have a glance over the Windows platform code this weekend, see if anything looks suspicious! |
I've looked at the Windows code and it seems that it might indeed be necessary to invoke the method channel functions from the main thread. Currently it's done in the callback handler:
The bad news is, while there is an example of how to do this on Android and iOS in the Flutter documentation, there's nothing on how to do this on windows. There's an issue by the flutter team about adding functionality to Flutter that would help developers do this on Windows (and an alternative solution here). Until then, the way to go would probably be the hidden message loop mentioned in the issue. Since I don't have much time on my hands right now, I'm afraid we'd need someone with Windows / C++ experience to try their hands on a PR, or we'll have to wait until Flutter provides an API to do this. |
Version of plugin: nsd: ^2.3.0
Same code works on iOs and Android without problem.
Here is what Windows event viewer reporst:
Faulting application name: hn_app_flutter.exe, version: 1.0.0.0, time stamp: 0x649e81df
Faulting module name: nsd_windows_plugin.dll, version: 0.0.0.0, time stamp: 0x64914406
Exception code: 0xc000041d
Fault offset: 0x0000000000025069
Faulting process id: 0x41c0
Faulting application start time: 0x01d9ab2322902b48
Faulting application path: C:\Projects\hn-app-flutter\build\windows\runner\Debug\hn_app_flutter.exe
Faulting module path: C:\Projects\hn-app-flutter\build\windows\runner\Debug\nsd_windows_plugin.dll
Report Id: cf6b7327-95b1-4fff-9388-9634dc8d49e5
Faulting package full name:
Faulting package-relative application ID:
The text was updated successfully, but these errors were encountered: