Dhiren Basra
Dhiren Basra

Reputation: 860

No Such Module Flutter

I've run the flutter app from XCode Using XCode version 13.2.1 (latest in January 2022) XCode showing error like mentioned in image :

No SUch Module Flutter

It is claimed by the Flutter team to be a bug with the visual component of XCode... as evidenced by the fact that the project will still build and run from XCode.

There are many reported ways to get rid of it temporarily, such as doing Product\build , Product\Clean Build Folder, or running the project on IOS from within Android Studio...

But these are only temporary and the problem will reappear.

https://github.com/flutter/flutter/issues/92337

How to get rid of this critical issue in XCode, thanks in advance.

Upvotes: 4

Views: 6471

Answers (1)

MαπμQμαπkγVπ.0
MαπμQμαπkγVπ.0

Reputation: 6729

If you have tried previous suggested solutions and it doesn't work, try these workaround instead.

Note: This is just temporary solution and most probably the problem may reappear because it was claimed by the Flutter team that this is a bug on the Xcode's end. This is currently being tracked in this open issue ticket.

Check if Flutter.xcframework not present in your apps Flutter module, then do the following:

  1. Create a new flutter module in the root of app using flutter build ios-framework --output=Flutter command in your app per "https://docs.flutter.dev/development/add-to-app/ios/project-setup#option-b---embed-frameworks-in-xcode". It will create Debug files (if you want to create Release Files, you should use the 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 as mentioned 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.

Upvotes: 2

Related Questions