Flutter - Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator

后端 未结 9 1610
生来不讨喜
生来不讨喜 2020-12-24 11:57

After updating to Catalina 10.15.4 beta with Xcode 13.4 beta, which also updated Simulator to 13.4 (921.4).

The application compiles and runs correctly on a physical

9条回答
  •  一向
    一向 (楼主)
    2020-12-24 12:37

    I have tried the solution on the official website of flutter but it didn't work for me, so I found a temporary solution which worked for me, but it took me some hard works: Here is my example with project stuck_framework which is a fresh new project (first time run on the simulator)

    1. I created 2 folders inside flutter project called
      "ios_simulator" and "ios_real_device". enter image description here

    2. Now my first build was for the simulator, then I want to switch to a real device, I will move ios folder inside Flutter project to the "ios_simulator"

    3. I open the project with visual studio code and run "flutter create ." and now I will choose a real device to rebuild the project ( if your simulator is online, please quit ). enter image description here
    4. Now I wait for the build finish and run on the real device without any errors. Now I have 2 ios project 1 for simulators and one for real devices.
    5. Next time when I want to run on the simulator again, I just remove the current ios folder and copy the ios folder which I placed on "ios_simulator" back out to flutter project folder. Hope this help

提交回复
热议问题