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, on Ubuntu 20.04.3.
The project was running fine before I updated the flutter version
2
Answers
you can simply fix this problem by overriding the dependency, put the following code in your pubspec.yaml and that would fix your problem:
For me was flutter screen utils and google font
i did first is type
flutter pub upgrade
orflutter pub upgrade --major-versions
then i change my ext.kotlin to latest in android folder then build gradle to
ext.kotlin = '1.6.20
‘ toext.kotlin_version = '1.8.21'
then i able to run my project i hope this helps.