ios 模拟器构建工作正常,但真实设备构建在 flutter 中失败

标签 ios xcode flutter compiler-errors runtime-error

目前 flutter ios 构建面临一些问题。然后应用程序使用 flutter run 运行,对于 ios 模拟器 它可以工作,但如果连接了 真实设备,同样会失败。

下面是错误代码。

Non-fat binary /Users/x/demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/App.framework/App is not arm64. Running lipo -info:
Non-fat file: /Users/x/demo/build/ios/Debug-iphoneos/Runner.app/Frameworks/App.framework/App is architecture: x86_64
Command /bin/sh failed with exit code 1

架构已添加,但仍然是这个问题。

enter image description here

此外,我确实尝试安装 pod 或更新它,但仍然没有任何好处。

编辑:附加 Flutter Doctor 图片。

enter image description here

最佳答案

该错误一定是由于签名功能造成的。尝试从 xcode 运行该项目。

按照以下步骤操作:

第一步:打开项目的ios文件夹,找到Runner.xcworkspace。它应该看起来像这样:

enter image description here

第 2 步:当 xcode 打开时,单击窗口左上角的 Runner。

enter image description here

第 3 步:转到“签名和功能”,然后在“团队”下拉列表下选择一个字段。如果不存在,请创建一个帐户。

enter image description here

第 4 步:在“ bundle 标识符”中,应显示您的应用程序的 bundle 名称。最后添加.app。例如,如果其“com.example.yourapp”,请将其设置为“com.example.yourapp.app”并按 Enter 键。

按左上角的播放按钮可在所选设备上运行应用程序。


如果不起作用,

在 xcode 中更改 flutter 目标运行器 - 仅构建事件架构:是

enter image description here

关于ios 模拟器构建工作正常,但真实设备构建在 flutter 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59774730/

相关文章:

ios - 如何将 NSAttributedString 绑定(bind)到 UITextView

ios - 在 Lion 中将旧版 iOS SDK 添加到 Xcode 4.1

ios - Xcode 摘要中的应用程序图标似乎很小

iphone - 如何检查*number*是否在数组中

具有固定底部和可滚动上部的 Flutter 布局

ios - NFC NDEF 在 IOS 编码上的写入

ios - 在 UITextView 上启用滚动

ios - 如何在 tableview Custom Cell 上为 UIView 的左上角和右上角设置圆角半径?

ios - 游戏 Assets 有时不出现

flutter pageview Wear os向右滑动关闭应用程序