Skip to content

[Compile]: [Windows] Compilation failure on device_info_plus and package_info_plus due to strict win32 v6.x and win32_registry v3.x migration #3930

Description

@armaganX

Operating System

windows 11

Plugin

device_info_plus, package_info_plus

Version

device_info_plus: ^13.2.0, package_info_plus: ^10.2.1

Flutter SDK

Flutter 3.44.4 • channel stable

Compilation command

Describe the bug

When compiling a Flutter project for Windows, we encounter multiple compilation errors in both device_info_plus and package_info_plus because they rely on the newly migrated win32 v6.x and win32_registry v3.x architectures.

While this modernization is great, it creates a dead-end dependency resolution conflict for projects that also rely on other widely-used packages in the Flutter ecosystem that are still strictly bound to win32 v5.x (such as file_picker and flutter_quill).

Steps to reproduce

  1. Add modern Firebase packages (e.g., firebase_core: 4.11.0 to support iOS SPM), which automatically resolve to device_info_plus: 13.2.0 and package_info_plus: 10.2.1.
  2. Add packages like file_picker: ^11.0.2 and flutter_quill: ^11.5.1 which depend on win32 ^5.x.
  3. If we force win32: 5.15.0 via dependency overrides to keep those packages compiling, the compilation of device_info_plus and package_info_plus fails on Windows with the errors below.

Expected behavior

There should be a way to resolve/compile these essential plugins without completely breaking projects that still require win32 v5.x ecosystem compatibility on Windows.

Actual compiler output / errors

During flutter run -d windows or flutter build windows, the compiler crashes with the following errors:

From device_info_plus-13.2.0:

/lib/src/device_info_plus_windows.dart:52:33: Error: The getter 'LOCAL_MACHINE' isn't defined for the type 'DeviceInfoPlusWindowsPlugin'.
      final currentVersionKey = LOCAL_MACHINE.open(
                                ^^^^^^^^^^^^^
/lib/src/device_info_plus_windows.dart:124:18: Error: The getter 'value' isn't defined for the type 'int'.
      if (result.value) {
                 ^^^^^

### Dart Dependencies

```yaml
dependencies:
  
  firebase_core: 4.11.0
  firebase_analytics: 12.4.3
  firebase_messaging: 16.4.1
  firebase_crashlytics: 5.2.4
  firebase_remote_config: 6.5.3


  device_info_plus: 13.2.0
  package_info_plus: 10.2.1


  file_picker: ^11.0.2
  flutter_quill: ^11.5.1


dependency_overrides:
  win32: 5.15.0
  win32_registry: 2.1.1

Native dependencies

- OS: Windows 10 / Windows 11
- Compiler: Visual Studio 2022 (Community/Professional) with "Desktop development with C++" workload
- Windows SDK: 10.0.x (or higher)
- CMake: 3.x

Compilation Error

/D:/Users/32467292780/AppData/Local/Pub/Cache/hosted/pub.dev/device_info_plus-13.2.0/lib/src/device_info_plus_windows.dart:52:33: Error: The getter 'LOCAL_MACHINE' isn't defined for the type 'DeviceInfoPlusWindowsPlugin'.
      final currentVersionKey = LOCAL_MACHINE.open(
                                ^^^^^^^^^^^^^
/D:/Users/32467292780/AppData/Local/Pub/Cache/hosted/pub.dev/device_info_plus-13.2.0/lib/src/device_info_plus_windows.dart:124:18: Error: The getter 'value' isn't defined for the type 'int'.
      if (result.value) {
                 ^^^^^
/D:/Users/32467292780/AppData/Local/Pub/Cache/hosted/pub.dev/device_info_plus-13.2.0/lib/src/device_info_plus_windows.dart:127:68: Error: The getter 'error' isn't defined for the type 'int'.
        developer.log('Failed to get system memory', error: result.error);
                                                                   ^^^^^
/D:/Users/32467292780/AppData/Local/Pub/Cache/hosted/pub.dev/package_info_plus-10.2.1/lib/src/file_attribute.dart:45:37: Error: The method 'toPcwstr' isn't defined for the type 'String'.
    final lptstrFilename = filePath.toPcwstr();
                                    ^^^^^^^^
/D:/Users/32467292780/AppData/Local/Pub/Cache/hosted/pub.dev/package_info_plus-10.2.1/lib/src/file_version_info.dart:103:44: Error: Too few positional arguments: 4 required, 3 given.
      final infoResult = GetFileVersionInfo(lptstrFilename, dwLen, lpData);
                                           ^

Target kernel_snapshot_program failed: Exception
FAILURE: Build failed with an exception.
Execution failed for task ':app:compileFlutterBuildPreDebug'.

Flutter Doctor

[√] Flutter (Channel stable, 3.44.4, on Microsoft Windows [Version 10.0.26200.8655], locale tr-TR) [816ms]
    • Flutter version 3.44.4 on channel stable at C:\src\flutter_windows_3.44.4-stable\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ad70ec4617 (3 weeks ago), 2026-06-24 11:07:06 -0700
    • Engine revision a10d8ac38d
    • Dart version 3.12.2
    • DevTools version 2.57.0
    • Feature flags: no-enable-web, enable-linux-desktop, enable-macos-desktop, no-enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, no-enable-swift-package-manager, omit-legacy-version-file,
      enable-lldb-debugging, enable-uiscene-migration

[√] Windows Version (11 Enterprise 64-bit, 25H2, 2009) [2,4s]

[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [18,1s]
    • Android SDK at D:\Users\32467292780\AppData\Local\Android\Sdk
    • Emulator version 36.3.10.0 (build_id 14472402) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • ANDROID_HOME = D:\Users\32467292780\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Java\jdk-17\bin\java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201)
    • All Android licenses accepted.

[√] Connected device (1 available) [732ms]
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 14 (API 34) (emulator)

[!] Network resources [5,1s]
    X A network error occurred while checking "https://pub.dev/": The remote computer refused the network connection
    X A network error occurred while checking "https://storage.googleapis.com/": The remote computer refused the network connection
    X A network error occurred while checking "https://maven.google.com/": The remote computer refused the network connection
    X A network error occurred while checking "https://cocoapods.org/": The remote computer refused the network connection
    X A network error occurred while checking "https://github.com/": The remote computer refused the network connection

! Doctor found issues in 1 category.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions