之前Flutter项目都妥妥的,升级Xcode11.4后却报错。
error: Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator. (in target 'Runner' from project 'Runner')
别急,首先Clean下项目,在项目根目录下:
flutter clean
然后删除ios/Flutter/App.framework:
rm -rf ios/Flutter/App.framework
再次运行,应该就OK了。
如果还是不行的话,双击ios/Runner.xcworkspace。在Xcode左侧Navigator中,删除App.framework和Flutter.framework。
在Runner Target -> Build Phases -> Link Binary With Libraries和Embed Frameworks中,确认下图红框中没有App.framework和Flutter.framework。