Home > Software engineering >  No such module 'Flutter' : Xcode 13.2.1
No such module 'Flutter' : Xcode 13.2.1

Time:06-23

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?

CodePudding user response:

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

CodePudding user response:

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.
  • Related