Flutter-为iOS构建,但是为iOS Simulator构建了链接和嵌入式框架'App.framework' [英] Flutter - Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator

查看:643
本文介绍了Flutter-为iOS构建,但是为iOS Simulator构建了链接和嵌入式框架'App.framework'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Xcode 13.4 beta更新到Catalina 10.15.4 beta之后,它还将Simulator更新为13.4(921.4).

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 physically attached device, but no simulators of any devices can pass this stage.

我收到了错误

为iOS构建,但是为iOS Simulator构建了链接和嵌入式框架'App.framework'.

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

是为iOS Simulator构建的,但是链接和嵌入式框架'App.framework'是为iOS构建的.

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

我该如何解决?

推荐答案

Xcode 11.4更改了框架的链接和嵌入式方式,您可能会遇到在iOS设备和模拟器之间切换的问题. Flutter v1.15.3和更高版本将自动迁移您的Xcode项目.

Xcode 11.4 changed the way frameworks are linked and embedded, and you may experience issues switching between iOS devices and simulators. Flutter v1.15.3 and later will automatically migrate your Xcode project.

要避免卡住,请按照以下说明进行操作;

To get unstuck, follow the instructions below;

  • 快速修复(使模拟器正常工作)
  • Quick fix (make your simulator work)

rm -rf ios/Flutter/App.framework

  • 官方建议手动迁移的步骤

  • Official recommended Steps to migrate manually

  1. 从Flutter应用程序目录中,打开ios/Runner.xcworkspace Xcode.
  2. 在导航器"窗格中,找到Flutter组,然后删除App.framework和Flutter.framework.
  3. 在Runner目标构建设置中,构建阶段">使用库链接二进制文件"确认不再存在App.framework和Flutter.framework.还要在构建阶段">嵌入框架"中进行确认.
  1. From the Flutter app directory, open ios/Runner.xcworkspace in Xcode.
  2. In the Navigator pane, locate the Flutter group and remove App.framework and Flutter.framework.
  3. In the Runner target build settings Build Phases > Link Binary With Libraries confirm App.framework and Flutter.framework are no longer present. Also confirm in Build Phases > Embed Frameworks.

  1. 按以下步骤更改Runner目标构建设置Build Phases> Thin Binary脚本:

  1. Change the Runner target build settings Build Phases > Thin Binary script as follows:

/bin/sh"$ FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" 嵌入

/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed

/bin/sh"$ FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" 薄

/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin

  1. 在Runner目标中 Build Settings> Other Linker Flags

(OTHER_LDFLAGS)添加$(继承)-frame Flutter

(OTHER_LDFLAGS) add $(inherited) -framework Flutter

希望有帮助!

这篇关于Flutter-为iOS构建,但是为iOS Simulator构建了链接和嵌入式框架'App.framework'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆