Reputation: 71
After upgrading to Flutter 3.0 I am no longer able to build any of my apps for either iOS or Android and get the same errors in both builds:
: Error: Member not found: 'UnicodeChar'.
int get UnicodeChar => Char.UnicodeChar;
^^^^^^^^^^^
: Error: Setter not found: 'UnicodeChar'.
set UnicodeChar(int value) => Char.UnicodeChar = value;
^^^^^^^^^^^
: Error: Member not found: 'AsciiChar'.
int get AsciiChar => Char.AsciiChar;
^^^^^^^^^
: Error: Setter not found: 'AsciiChar'.
set AsciiChar(int value) => Char.AsciiChar = value;
^^^^^^^^^
and these errors are in the file "src/structs.g.dart" (part of Flutter/Dart as far as I can tell) as follows:
/// {@category Struct}
class _CHAR_INFO__Char_e__Union extends Union {
@Uint16()
external int UnicodeChar;
@Uint8()
external int AsciiChar;
}
extension CHAR_INFO_Extension on CHAR_INFO {
int get UnicodeChar => Char.UnicodeChar;
set UnicodeChar(int value) => Char.UnicodeChar = value;
int get AsciiChar => Char.AsciiChar;
set AsciiChar(int value) => Char.AsciiChar = value;
}
I am running VSCode 1.67.1 on macOS Monterey 12.3.1 and
flutter doctor -v
shows no errors found.
It appears that the file "src/structs.g.dart" seems to be part of the Win32 components in "pub.dartlang.org" but I am not building my apps for Windows (yet).
Any ideas on what I need to do to be able to build for iOS and Android again will be much appreciated.
Thanks
Les
Upvotes: 6
Views: 3590
Reputation: 671
Steps to solve your problem:
First Of all, You Need To Update all Third-party Packages
flutter pub upgrade --major-versions
Now You need to clean your project
flutter clean
Delete "pubspec.lock" file at the root of your project (manually or run the script)
rm -rf pubspec.lock
Now, You need to Get all Packages
flutter pub get
Now you can run your project and the error should be solved ;)
Upvotes: 2
Reputation: 1
Downgrade flutter to the previous version "flutter downgrade" until an upgrade to flutter 3.0.0 is provided by the owners of all packages you are using in your project.
Upvotes: 0
Reputation: 9
Step 1: Delete pod folder in ios.
Step 2: uncomment the code at the line # platform :ios, '9.0' in Podfile.
Step 3: change line platform :ios, '9.0' to platform :ios, '10.0'
Step 4: run : flutter pub upgrade
Step 5: cd ios , run pod install
Step 6: run pod repo update
and sudo gem install cocoapods
and run again pod repo update
and run pod install
Step 7: run again project . goodluck
Upvotes: 1
Reputation: 1510
So, something which helped me:
/Users/your-user/.pub-cache/hosted/pub.dartlang.org
flutter pub upgrade
and then try to run your project 🎉
Upvotes: 3
Reputation: 12343
Delete the build folder, run flutter clean. I had the same problem with a macOS project and had to delete the macOs folder. Works fine afterwards.
Upvotes: 0