Skip to content
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]: App crashes on windows 10 VM by calling getSystemMemoryInMegabytes #3444

Closed
8 tasks done
KMantas opened this issue Jan 27, 2025 · 1 comment
Closed
8 tasks done
Labels
bug Something isn't working triage

Comments

@KMantas
Copy link

KMantas commented Jan 27, 2025

Platform

Windows 10

Plugin

device_info_plus

Version

11.2.1

Flutter SDK

3.27.2

Steps to reproduce

This seems to be duplicated issue

but I cannot reopen it.

My app is running fine on win11, but I tried to test installation in VM, so I downloaded win10 iso and it wouldn't start there. I attached debug message I got by running
app.exe>> logFile.txt 2>&1

Problem is this code:

`
device_info_plus/src/device_info_plus_windows.dart:128

throw WindowsException(HRESULT_FROM_WIN32(error));
`

Is there a reason to through exception here and in other places instead of returning default values?
I could catch it if I was calling it in my code, but it is called by another plugin.
As a quick fix I commented that line and replaced it with return 0;

Code Sample

Logs

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Error 0x00000000: The operation completed successfully.
#0      DeviceInfoPlusWindowsPlugin.getSystemMemoryInMegabytes (package:device_info_plus/src/device_info_plus_windows.dart:128)
#1      DeviceInfoPlusWindowsPlugin.getInfo (package:device_info_plus/src/device_info_plus_windows.dart:88)
#2      DeviceInfoPlusWindowsPlugin.deviceInfo (package:device_info_plus/src/device_info_plus_windows.dart:40)
#3      DeviceInfoPlugin.windowsInfo (package:device_info_plus/device_info_plus.dart:93)
#4      main (package:admin_app/main.dart:353)
<asynchronous suspension>

Flutter Doctor

[!] Flutter (Channel [user-branch], 3.27.2, on Microsoft Windows [Version
    10.0.22631.4751], locale en-US)
    ! Flutter version 3.27.2 on channel [user-branch] at C:\soft\flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an
      official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions      at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss
      this error.
    • Framework revision 68415ad1d9 (2 weeks ago), 2025-01-13 10:22:03 -0800
    • Engine revision e672b006cb
    • Dart version 3.6.1
    • DevTools version 2.40.2
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\manta\AppData\Local\Android\sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.4.33205.214
    • Windows 10 SDK version 10.0.26100.0

[√] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] VS Code (version 1.96.2)
    • VS Code at C:\Users\manta\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.4751]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 132.0.6834.110
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 132.0.2957.127

[√] Network resources
    • All expected network resources are available.

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@KMantas KMantas added bug Something isn't working triage labels Jan 27, 2025
@miquelbeltran
Copy link
Member

Duplicated from #2957
Please use the search function next time

@fluttercommunity fluttercommunity locked as spam and limited conversation to collaborators Jan 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants