Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Flutter projects fail do build due to incompatible dependencies #14

Open
MrCyjaneK opened this issue May 2, 2023 · 1 comment
Open

Comments

@MrCyjaneK
Copy link

After adding

  ensemble_ts_interpreter:
    git:
      url: https://github.com/EnsembleUI/ensemble_ts_interpreter.git
      ref: master

to pubspec.yaml a broken dependency - package_info_plus is being added.

$ flutter pub deps
|-- ensemble_ts_interpreter 1.0.0+1
[...]
|   |-- json_dynamic_widget 3.1.1+1
|   |   |-- automated_testing_framework 3.2.3
[...]
|   |   |   |-- package_info_plus 1.4.3+1
|   |   |   |   |-- package_info_plus_linux 1.0.5

in this file: C:\Users\user\AppData\Local\Pub\Cache\hosted\pub.dev\package_info_plus_windows-2.1.0\lib\src\file_version_info.dart on lines 11 - 17 there is a broken part of code:

class _LANGANDCODEPAGE extends Struct {
  @Uint16()
  external int? wLanguage;

  @Uint16()
  external int? wCodePage;
}
$ flutter run --device-id windows
Launching lib\main.dart on Windows in debug mode...
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/package_info_plus_windows-2.1.0/lib/src/file_version_info.dart(13,17): error G99FC7582: Field 'wLanguage' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. [C:\Users\user\Documents\....\build\windows\flutter\flutter_assemble.vcxproj]
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/package_info_plus_windows-2.1.0/lib/src/file_version_info.dart(16,17): error G99FC7582: Field 'wCodePage' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. [C:\Users\user\Documents\....\build\windows\flutter\flutter_assemble.vcxproj]

After patching the file_version_info.dart to use int instead of int?

class _LANGANDCODEPAGE extends Struct {
  @Uint16()
  external int wLanguage;

  @Uint16()
  external int wCodePage;
}

The app compiles fine.

Updating to version 3.0.0 of package_info_plus_windows still have the same Struct with int? so it may not fix the issue.

$ flutter doctor -v
[√] Flutter (Channel beta, 3.10.0-1.4.pre, on Microsoft Windows [Version 10.0.22621.525], locale en-GB)
    • Flutter version 3.10.0-1.4.pre on channel beta at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14a4eac61 (6 days ago), 2023-04-26 12:54:31 +0700
    • Engine revision f7ac42e8a2
    • Dart version 3.0.0 (build 3.0.0-417.3.beta)
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)
[...]
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.5.33516.290
    • Windows 10 SDK version 10.0.22000.0
[...]
[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.525]
[...]
[√] Network resources
    • All expected network resources are available.

• No issues found!
@kmahmood74
Copy link
Collaborator

this repo is being used inside https://github.com/EnsembleUI/ensemble without any issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants