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?
Asked
Active
Viewed 5,845 times
3
-
Did you try `flutter clean`? – Harish Sharma Jun 21 '22 at 11:10
-
1I did it many times, then deleted Pod.lock, Pods folder and Runner.xcworkspace then do "Pod install", then "cleaned build folder" in xcode , then do "Pod update" without any change. – Saad Aboulsooud Abdelmoaty Ali Jun 21 '22 at 11:24
-
Are you opening the xcworkspace? – cora Jun 21 '22 at 14:07
-
This is a duplicate https://stackoverflow.com/questions/69987403/no-such-module-flutter – cora Jun 21 '22 at 14:10
3 Answers
7
FINALLY I SOLVED IT.
The problem was there is no "Flutter.xcframework" in my app's flutter module.
The solution
- 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").
- 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".
- Go to your target > Build Setting > Framework Search Paths and add $(PROJECT_DIR)/Flutter/[Build-mode]/Flutter.xcframework respectively.
- Clean your build folder & run again.

Saad Aboulsooud Abdelmoaty Ali
- 101
- 1
- 6
-1
- You try it run flutter clean and flutter pub get and in ios folder run pod install. Good luck!

Huy Dev
- 26
- 1
- 3
-1
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.

Bikey
- 935
- 7
- 12