Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having to run Flutter Clean and remove framework everytime I switch building from Physical iOS and Simulator

I have a flutter Project I started a month ago. Yesterday my xcode automatically updated and began having this error

error: Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator. (in target 'Runner' from project 'Runner')

The only way I can make it work is to run the two commands below $ flutter clean $ rm -rf ios/Flutter/App.framework ios/Flutter/Flutter.framework

so Now it runs smoothly on the physical device but if I want to run on the simulator again I get a similar error without the word "Simulator" in it like this

error: Building for iOS Simulator, but the linked and embedded framework 'App.framework' was built for iOS. (in target 'Runner' from project 'Runner')

To get it to work I have to run the two commands again.

Is this normal behaviour? I am sure the solution is simple? sorry I am new to flutter and iOS development. is there a way to have both frameworks in there for iOS Physical and for iOS Simulator so I don't have to clean and remove frameworks? Please let me know how exactly to add both. Steps would really be appreciated

Thank you!

like image 387
Raed Tulefat Avatar asked Mar 25 '20 16:03

Raed Tulefat


1 Answers

Xcode 11.4 changed the way frameworks are linked and embedded. Flutter v1.15.3 and later will automatically migrate your Xcode project.

In the meantime, to fix it manually, follow the following instructions: https://flutter.dev/docs/development/ios-project-migration

like image 119
Filipe Avatar answered Sep 20 '22 20:09

Filipe