flutterxcodedart

Flutter requires Xcode 14 or higher


`I recently updated my Flutter version and then I ran the Flutter Doctor command, and in my terminal it says everything is fine, but you need to update xcode, while the AppStore has not given any update for xcode.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.1, on macOS 12.6 21G115 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[!] Xcode - develop for iOS and macOS (Xcode 13.4)
    ✗ Flutter requires Xcode 14 or higher.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.81.1)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.

Doctor found issues in 1 category. `


Solution

  • Make sure you've installed the latest macOS software. And latest Xcode version. In your case it looks like your Xcode version can be updated to at least 14.2. So you should be good to go

    But for those if your Mac doesn't support at least Xcode 14.0.0 then you can force it to make it so that your Xcode version is recognised as the minimum required by doing as follows:

    Navigate over to FLUTTER_ROOT_DIRECTORY/flutter/packages/flutter_tools/lib/src/macos/xcode.dart in my case it is: /Users/user/Desktop/development/flutter/packages/flutter_tools/lib/src/macos/xcode.dart

    and replace:

    Version get xcodeRequiredVersion => Version(14, null, null);
    

    with

    Version get xcodeRequiredVersion => Version(13, 2, null);
    

    and head over to /Users/user/Desktop/development/flutter/bin and delete the "cache" folder

    now on a new terminal run flutter doctor

    should be good to go then :) enter image description here

    as you can see I'm using macOS 11.7.10, flutter 3.19.6 & Xcode 13.2.1