Reputation: 860
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 :
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
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:
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
).
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".
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.
Upvotes: 2