Flutter: Instructions to fix the error after updating XCode to 11.4

Tram Ho

This article is for you who are still in Flutter’s stable branch (Channel stable, v1.12.13 + hotfix.9 or smaller) or when building an App you get the following error:

Building for iOS, but the linked and embedded framework ‘App.framework’ was built for iOS Simulator.


Building for iOS Simulator, but the linked and embedded framework ‘App.framework’ was built for iOS.

To fix the above error, you follow my instructions step by step below:

  1. Open the ios / Runner.xcworkspace file in your Flutter project
  2. You look over the Navigation Pane of XCode, inside the Flutter folder you will see App.framework and Flutter.framework .
  3. Gently remove them by Select -> right mouse -> Delete.

After removing, select Target Runner -> Build Phases> Link Binary With Libraries and Embed Frameworks to ensure that there are no more App.framework and Flutter.framework files.

Still in that build Phases , select Thin Binary and add the following script:

And finally, you select Target Runner -> Other Linker Flags , add the following lines if not $ (inherited) -framework Flutter

Finally, if you still do not understand the components in XCode, I will give you a picture of all the components in XCode that we often use without paying attention.

Note : Flutter v1.15.3 and later versions have automatically migrated to your XCode project.

If you want to see quality posts, or discuss your insights, share your insights with others, join our group on Facebook : ^^

Share the news now

Source : Viblo