Skip to content

Upgrade package_info_plus_windows to use latest win32 dependency #163

Description

@gibutm

System info

Issue occurs on: Windows, MacOS
Plugin name: package_info_plus_windows
Plugin version: 0.2.0
Flutter doctor output:

[✓] Flutter (Channel dev, 1.27.0-4.0.pre, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-AE)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Connected device (2 available)

• No issues found!

Steps to Reproduce

  1. Add package_info_plus 0.6.4 to dependencies
  2. Add path_provider 2.0.0-nullsafety.1 to dependencies
  3. Run 'flutter pub get' and observe version resolution failure.
  4. Override win32 dependency to version 2.0.0 will also fail due to dart compilation failure.

Logs

Logs for step 3

Because no versions of path_provider match >2.0.0-nullsafety.1 <3.0.0 and path_provider 2.0.0-nullsafety.1 depends on path_provider_windows ^0.1.0-nullsafety.3, path_provider ^2.0.0-nullsafety.1 requires path_provider_windows ^0.1.0-nullsafety.3.
And because no versions of path_provider_windows match >0.1.0-nullsafety.3 <0.2.0 and path_provider_windows 0.1.0-nullsafety.3 depends on win32 ^2.0.0-nullsafety.12, path_provider ^2.0.0-nullsafety.1 requires win32 ^2.0.0-nullsafety.12.
And because package_info_plus_windows 0.2.0 depends on win32 ^1.7.3 and no versions of package_info_plus_windows match >0.2.0 <0.3.0, path_provider ^2.0.0-nullsafety.1 is incompatible with package_info_plus_windows ^0.2.0.
And because package_info_plus 0.6.4 depends on package_info_plus_windows ^0.2.0 and no versions of package_info_plus match >0.6.4 <0.7.0, path_provider ^2.0.0-nullsafety.1 is incompatible with package_info_plus ^0.6.4.
So, because xxxxxx depends on both package_info_plus ^0.6.4 and path_provider ^2.0.0-nullsafety.1, version solving failed.

Logs for step 4

../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:35:21: Error: The method 'free' isn't defined for the class '_FileVersionInfo'.
 - '_FileVersionInfo' is from 'package:package_info_plus_windows/src/package_info_plus_windows_real.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/package_info_plus_windows_real.dart').
Try correcting the name to the name of an existing method, or defining a method named 'free'.
  void dispose() => free(_data.lpBlock);
                    ^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:61:24: Error: The method 'allocate' isn't defined for the class '_FileVersionInfo'.
 - '_FileVersionInfo' is from 'package:package_info_plus_windows/src/package_info_plus_windows_real.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/package_info_plus_windows_real.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allocate'.
    final lplpBuffer = allocate<IntPtr>();
                       ^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:62:19: Error: The method 'allocate' isn't defined for the class '_FileVersionInfo'.
 - '_FileVersionInfo' is from 'package:package_info_plus_windows/src/package_info_plus_windows_real.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/package_info_plus_windows_real.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allocate'.
    final puLen = allocate<Uint32>();
                  ^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:71:7: Error: The method 'free' isn't defined for the class '_FileVersionInfo'.
 - '_FileVersionInfo' is from 'package:package_info_plus_windows/src/package_info_plus_windows_real.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/package_info_plus_windows_real.dart').
Try correcting the name to the name of an existing method, or defining a method named 'free'.
      free(lpSubBlock);
      ^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:80:5: Error: The method 'free' isn't defined for the class '_FileVersionInfo'.
 - '_FileVersionInfo' is from 'package:package_info_plus_windows/src/package_info_plus_windows_real.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/package_info_plus_windows_real.dart').
Try correcting the name to the name of an existing method, or defining a method named 'free'.
    free(lplpBuffer);
    ^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:81:5: Error: The method 'free' isn't defined for the class '_FileVersionInfo'.
 - '_FileVersionInfo' is from 'package:package_info_plus_windows/src/package_info_plus_windows_real.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/package_info_plus_windows_real.dart').
Try correcting the name to the name of an existing method, or defining a method named 'free'.
    free(puLen);
    ^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:87:23: Error: Method not found: 'allocate'.
    final lpdwDummy = allocate<Uint32>();
                      ^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:89:21: Error: Method not found: 'allocate'.
    final lpBlock = allocate<Uint8>(count: dwBlockSize);
                    ^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:94:25: Error: Method not found: 'allocate'.
    final lpTranslate = allocate<IntPtr>();
                        ^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:102:5: Error: Method not found: 'free'.
    free(lptstrFilename);
    ^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:103:5: Error: Method not found: 'free'.
    free(lpTranslate);
    ^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:104:5: Error: Method not found: 'free'.
    free(lpSubBlock);
    ^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-0.2.0/lib/src/file_version_info.dart:105:5: Error: Method not found: 'free'.
    free(lpdwDummy);
    ^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/lib/src/path_provider_windows_real.dart:37:33: Error: The method 'toDartString' isn't defined for the class 'Pointer<Utf16>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Utf16' is from 'package:ffi/src/utf16.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.3.0-nullsafety.1/lib/src/utf16.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toDartString'.
      return valueAddress.value.toDartString();
                                ^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/lib/src/path_provider_windows_real.dart:67:23: Error: The method 'toDartString' isn't defined for the class 'Pointer<Utf16>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Utf16' is from 'package:ffi/src/utf16.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.3.0-nullsafety.1/lib/src/utf16.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toDartString'.
        path = buffer.toDartString();
                      ^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/lib/src/path_provider_windows_real.dart:135:37: Error: The method 'toDartString' isn't defined for the class 'Pointer<Utf16>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Utf16' is from 'package:ffi/src/utf16.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.3.0-nullsafety.1/lib/src/utf16.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toDartString'.
      final path = pathPtrPtr.value.toDartString();
                                    ^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.1.0-nullsafety.3/lib/src/path_provider_windows_real.dart:187:60: Error: The method 'toDartString' isn't defined for the class 'Pointer<Utf16>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Utf16' is from 'package:ffi/src/utf16.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.3.0-nullsafety.1/lib/src/utf16.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toDartString'.
            path.basenameWithoutExtension(moduleNameBuffer.toDartString());
                                                           ^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/src/exceptions.dart:52:31: Error: The method 'toDartString' isn't defined for the class 'Pointer<Utf16>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Utf16' is from 'package:ffi/src/utf16.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.3.0-nullsafety.1/lib/src/utf16.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toDartString'.
        errorMessage = buffer.toDartString();
                              ^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/src/utils.dart:32:46: Error: The method 'toNativeUtf16' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named 'toNativeUtf16'.
Pointer<Utf16> TEXT(String string) => string.toNativeUtf16();
                                             ^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/src/com/combase.dart:33:26: Error: The method 'toNativeUtf16' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named 'toNativeUtf16'.
  final lpszIID = strIID.toNativeUtf16();
                         ^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/src/com/combase.dart:54:30: Error: The method 'toNativeUtf16' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named 'toNativeUtf16'.
  final lpszCLSID = strCLSID.toNativeUtf16();
                             ^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/src/winrt/winrt_helpers.dart:36:34: Error: The method 'toDartString' isn't defined for the class 'Pointer<Utf16>'.
 - 'Pointer' is from 'dart:ffi'.
 - 'Utf16' is from 'package:ffi/src/utf16.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.3.0-nullsafety.1/lib/src/utf16.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toDartString'.
    final dartString = stringPtr.toDartString();
                                 ^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/src/winrt/winrt_helpers.dart:52:28: Error: The method 'toNativeUtf16' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named 'toNativeUtf16'.
  final stringPtr = string.toNativeUtf16();
                           ^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/src/winrt/winrt_helpers.dart:75:33: Error: The method 'toNativeUtf16' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named 'toNativeUtf16'.
  final lpClassName = className.toNativeUtf16();
                                ^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/src/winrt/winrt_helpers.dart:79:22: Error: The method 'toNativeUtf16' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named 'toNativeUtf16'.
  final iidPtr = iid.toNativeUtf16();
                     ^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/src/winrt/winrt_helpers.dart:80:34: Error: The method 'toNativeUtf16' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named 'toNativeUtf16'.
  final classNamePtr = className.toNativeUtf16();
                                 ^^^^^^^^^^^^^```

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions