"No such module 'Flutter'" Xcode error

I encounter this error when opening AppDelegate in Xcode. It occurs in both newly created projects and the existing project I am working on, affecting Flutter versions 3.27 and 3.29.

I am using Xcode 16.2.

Strangely, I can build and run the app on a device, but editing AppDelegate is frustrating because of this error. Xcode displays only this error and does not analyze the rest of the code for other errors or warnings.

Additionally, if I remove import Flutter, Xcode starts analyzing the code properly and displays all errors caused by the removal of the Flutter import.

I’ve tried to use this solution After updating to Xcode 16, I'm encountering a 'No such module 'Flutter'' error when trying to build for iOS · Issue #155873 · flutter/flutter · GitHub, but it didn’t help.

Actually I’ve managed to find solution: How to fix the “module Flutter not found” compiler error in Xcode | by Ademola (Fadumo) Babs-Samuel | Medium.

Flutter.xcframework should be manually added to Frameworks, Libraries, and Embedded Content and Xcode will start to recognize Flutter import.

Like this:

I have no idea why newly created Flutter projects also has this problem.