No such module 'Flutter' : Xcode 13.2.1

10k Views Asked by At

I'm trying to run a flutter app - iOS with the following environment Xcode Version 13.2.1 (13C100) flutter sdk: 2.10.5 dart: 2.16.2 mac processor: Intel Core i7 but I get "No such module 'Flutter'" inside a file in extension Target beside my Runner Target so how can I fix that issue?

4

There are 4 best solutions below

1
On BEST ANSWER

FINALLY I SOLVED IT.

The problem was there is no "Flutter.xcframework" in my app's flutter module.

The solution

  1. Create a new flutter module in the root of my app using "flutter build ios-framework --output=Flutter" command inside your app like in "https://docs.flutter.dev/development/add-to-app/ios/project-setup#option-b---embed-frameworks-in-xcode" and it will create Debug files (if you wanna create Release Files, you should use command "flutter build ios-framework --no-debug --no-profile --release --output=Flutter").
  2. Go to your target > Build Phases > Link Binary With Libraries then drag and drop Flutter.xcframework folder into it like in "https://docs.flutter.dev/development/add-to-app/ios/project-setup#link-on-the-frameworks".
  3. Go to your target > Build Setting > Framework Search Paths and add $(PROJECT_DIR)/Flutter/[Build-mode]/Flutter.xcframework respectively.
  4. Clean your build folder & run again.
0
On

In your pods list in XCode, select the Flutter pod and check the Build Options. Make sure the Debug field for example (if you are running in debug) is set to Yes and your Supported platforms is set.

0
On
  • You try it run flutter clean and flutter pub get and in ios folder run pod install. Good luck!
0
On

I had a similar problem, my problem was that the development certificate of the Apple developer account was expired, I believe it is Xcode new version (15) problem because when I have an old mac not updated. when I opened the project on the old xcode (14) it gave me the error straight away.

In my case the solution was simple, go to the Apple developer certificates page

Make sure that all certificates are not expired, and if you find any expired certificate, click on it and select revoke.

When you open the project if you already enabled automatic syncing it will create a new certificate for you.

I hope this helps someone, I spent days searching for the solution. you can check more solutions for this issue because it isn't only flutter-related: Getting error "No such module" using Xcode, but the framework is there