简体   繁体   中英

ios simulator build works but real device build fails in flutter

Currently facing some issue with the flutter ios building. then the app is run with flutter run for ios simulator it works but same fails if a real device is connected.

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.

Edit: Flutter Doctor image attached.

在此处输入图片说明

The error must be because of signing capabilities. Try to run the project from xcode.

Follow the steps:

Step 1: Open the ios folder of your project to find Runner.xcworkspace. It should look like this:

在此处输入图片说明

Step 2: When the xcode opens, click on Runner on the top left corner of the window.

在此处输入图片说明

Step 3: Go to Signing and Capabilities and under the "Team" dropdown, select a field. If none exists, create an account.

在此处输入图片说明

Step 4: In the "Bundle Identifier", your app's bundle name should be showing. Add .app in the end. For example, if its "com.example.yourapp" make it "com.example.yourapp.app" and press enter.

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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