When running the flutter build appbundle
command, I get the following error :
../../.pub-cache/hosted/pub.dev/package_info_plus_windows-2.1.0/lib/src/file_version_info.dart:13:17:
Error: Field 'wLanguage' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
external int? wLanguage;
^
../../.pub-cache/hosted/pub.dev/package_info_plus_windows-2.1.0/lib/src/file_version_info.dart:16:17:
Error: Field 'wCodePage' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
external int? wCodePage;
^
Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
I am using Flutter 3.10.0. The project was running fine before I updated the flutter version.
I finally fix my problem by overriding these packages in my project's
pubspec.yaml
or
Overriding the
package_info_plus
to^4.0.1
gave me the following error message because of my project dependencies.If you have a similar message after overriding the
package_info_plus
, you can check the dependent packages and add them todependency_overrides
and set the version toany
as in my above example.The
Any
keyword can be used to specify that any version of a package is acceptable. This can be useful if you want to make sure that your app is compatible with the latest version of a package, or if you want to avoid breaking changes that may be introduced in a future version of a package.