-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Bug]: DeviceInfoPlugin class on Windows 10 crashes when windowsInfo is called. #2957
Comments
Windows 10 version: Version 22H2 19045.3030 |
Interesting, it looks like the issue is here:
It is throwing an exception with the message "The operation completed successfully." Looking at SO, I saw this response: https://stackoverflow.com/a/6428680
I am not a Windows dev expert so no idea how to move this forward, I wonder if this is an internal issue with Flutter/Dart.
|
Hi @miquelbeltran , it runs fine on Windows 11. I am not sure why, did it work on your machine? Yes, it is happening 100% of the time. I didnt get a chance to downgrade Flutter and check. |
I only have a Win 11 computer, so I never saw this issue when I did my own testing. |
Can confirm that this works fine with Windows 11. Created a VM just to reproduce this. I just installed Visual Studio 2022 with C++ desktop and then installed the Flutter SDK to reproduce this. |
I also faced this issue with some clients running Windows RDS. |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Stop replying with "same problem", that will not fix the issue. If you want to help, submit a fix for the issue. Locking the thread to maintainers. |
I get this error every time when I run app on Windows 10 in VM, but it works fine on my windows 11. For testing I installed Windows 10 on VirtualBox. Exception is thrown by the package if returned memory is 0
For now I commented this and replaced with return 0; Because It used by another plugin. I don't call it directly. Wouldn't it be better to return empty or null values? Because now if one if these calls fail: getSystemMemoryInMegabytes, getComputerName, getUserName, then whole data structure isn't available. Sorry for creating a duplicate. I tried to reference this issue, but somehow it was removed. And I was not able to post anything here. |
There are three properties that will throw a I will do a PR returning default values instead of throwing, as I don't see the benefit of throwing an error, specially if 3rd party packages are not taking care of caching possible errors. Meanwhile I'd recommend you to override dependencies with a local fix. |
I'd appreciate if you can give a try to the PR #3445 |
Platform
Windows 10
Plugin
device_info_plus
Version
10.1.0
Flutter SDK
3.22.1
Steps to reproduce
void main() async { DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); print(await deviceInfo.windowsInfo); }
Exception has occurred.
WindowsException (Error 0x00000000: The operation completed successfully.)
Code Sample
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean
The text was updated successfully, but these errors were encountered: