简体   繁体   English

ios模拟器构建有效,但真实设备构建失败

[英]ios simulator build works but real device build fails in flutter

Currently facing some issue with the flutter ios building.目前在 flutter ios 构建方面面临一些问题。 then the app is run with flutter run for ios simulator it works but same fails if a real device is connected.然后该应用程序使用flutter run for ios simulator flutter run ,它可以工作,但如果连接了real device则同样会失败。

below is the error code.下面是错误代码。

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

architecture is been added but still this issue.架构已添加,但仍然是这个问题。

在此处输入图片说明

Also, I did try installing pod or updating it but still no benefits of the same.此外,我确实尝试安装pod或更新它,但仍然没有相同的好处。

Edit: Flutter Doctor image attached.编辑:附上 Flutter Doctor 图片。

在此处输入图片说明

The error must be because of signing capabilities.错误一定是因为签名功能。 Try to run the project from xcode.尝试从 xcode 运行项目。

Follow the steps:按照步骤:

Step 1: Open the ios folder of your project to find Runner.xcworkspace.第一步:打开你项目的ios文件夹,找到Runner.xcworkspace。 It should look like this:它应该是这样的:

在此处输入图片说明

Step 2: When the xcode opens, click on Runner on the top left corner of the window.第 2 步:当 xcode 打开时,单击窗口左上角的 Runner。

在此处输入图片说明

Step 3: Go to Signing and Capabilities and under the "Team" dropdown, select a field.第 3 步:转到签名和功能,然后在“团队”下拉菜单下选择一个字段。 If none exists, create an account.如果不存在,请创建一个帐户。

在此处输入图片说明

Step 4: In the "Bundle Identifier", your app's bundle name should be showing.第 4 步:在“Bundle Identifier”中,应显示您的应用程序包名称。 Add .app in the end.最后添加.app。 For example, if its "com.example.yourapp" make it "com.example.yourapp.app" and press enter.例如,如果它的“com.example.yourapp”使它成为“com.example.yourapp.app”并按回车键。

Press the play button on the top left to run the app on the selected device.按左上角的播放按钮在所选设备上运行应用程序。


If it doesn't work,如果它不起作用,

Change the flutter target runner in xcode - build active architecture only: yes更改 xcode 中的 flutter 目标运行器 - 仅构建活动架构:是

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM