我试图在M1Mac上建立一个Flutter 应用程序,得到以下错误.

$ flutter build ios --release
Building XXX for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: XXX
Running pod install...                                             13.2s
Running Xcode build...
Xcode build done.                                            6.7s
Failed to build iOS app
Error output from Xcode build:
↳
    objc[65074]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1f66de518) and ?? (0x1160d82b8). One
    of the two will be used. Which one is undefined.
    objc[65074]: Class AMSupportURLSession is implemented in both ?? (0x1f66de568) and ?? (0x1160d8308). One of the two
    will be used. Which one is undefined.
    ** BUILD FAILED **


Xcode's output:
↳
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    error: The linked framework 'Pods_Runner.framework' is missing one or more architectures required by this target:
    armv7. (in target 'Runner' from project 'Runner')

Encountered error while building for device.

这是我的flutter doctor -v美元

flutter doctor -v
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0 20A2411 darwin-arm, locale en-AU)
    • Flutter version 1.22.4 at /Users/mlee/development/flutter
    • Framework revision 1aafb3a8b9 (3 weeks ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4


[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/mlee/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

[✓] Connected device (2 available)
   

! Doctor found issues in 1 category.

推荐答案

我也有同样的问题.当我跑flutter build ios的时候,我看到了同样的错误.

错误消息在我的VS代码终端上显示为红色,但显示为it was kind of misleading.我发现这不是主要问题.

The actual issue should be on the following error section.

所以,请运行flutter build ios --verbose并仔细阅读输出.

在我的情况下,还有其他flutter build ios分不及格的问题.问题是忘记放入GoogleService-Info.plist或iOS目标版本低于Flutter 软件包的要求.

Ios相关问答推荐

(Flutter)获取图像从图像拾取器保存和加载问题

SwiftUI SF Symbols图像:暗模式图像

在选项卡内列出导航内视图断开导航标题的动画

底部导航栏在iOS上浮动

Xamarin Forms CustomPin iOS Render

ScrollViewReader Scrollto Not Working

如何在 Flutter 应用程序中测试来自 App/Play Store 的移动深层链接?

保存和读取登录到 keys 串不工作 IOS swift

更改初始控制器无效

如果使用 .onAppear 设置,为什么 SwiftUI Picker 不显示正确的选定值

SwiftUI - TextField - 在焦点上清除 Double 类型的值,在取消 Select 时恢复

iOS SwiftUI - 从以前的 struct 调用函数

如何快速设置条形按钮的图像?

在 UICollectionView 上动态设置布局导致莫名其妙的 contentOffset 变化

iPhone 6 和 6 Plus 媒体查询

关闭所有打开的视图控制器的单个函数

是否可以在没有 Mac 的情况下为 iOS 制作 PhoneGap 应用程序?

将 iPhone xib 转换为 iPad xib?

将自定义对象保存到 NSUserDefaults

SwiftUI - 列表行中的多个按钮