'Unable to build iOS or Android app after upgrade to Flutter 3.0

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



Solution 1:[1]

So, something which helped me:

  1. remove the next folder /Users/your-user/.pub-cache/hosted/pub.dartlang.org
  2. hit flutter pub upgrade

and then try to run your project ?

Solution 2:[2]

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.

Solution 3:[3]

  1. Step 1: Delete pod folder in ios.

  2. Step 2: uncomment the code at the line # platform :ios, '9.0' in Podfile.

  3. Step 3: change line platform :ios, '9.0' to platform :ios, '10.0'

  4. Step 4: run : flutter pub upgrade

  5. Step 5: cd ios , run pod install

  6. 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

Solution 4:[4]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Huthaifa Muayyad
Solution 3
Solution 4 SahilSelfmade