【问题标题】:Flutter will not build on iOS with Firebase on M1 MacFlutter 不会在带有 Firebase 的 iOS 上构建 M1 Mac
【发布时间】:2021-06-06 20:51:05
【问题描述】:

我一直尝试在 iOS 上构建我的 Flutter 应用程序,但我一直收到错误消息。我已经尝试了一切。我从 GitHub 导入了我的项目,并从 Windows 上传了它。 我遵循了每一步,并在 Firebase 上添加了 iOS 应用程序,现在当我想要编译时,我无法编译,而且非常沮丧。请帮忙。

objc[7346]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x20d9f4188) and ?? (0x113d402b8). One of the two will be
    used. Which one is undefined.
    objc[7346]: Class AMSupportURLSession is implemented in both ?? (0x20d9f41d8) and ?? (0x113d40308). One of the two will be used. Which one
    is undefined.
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/davor/Developer/Projects/Explovid/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'cloud_firestore' not found
    @import cloud_firestore;
     ~~~~~~~^~~~~~~~~~~~~~~
    1 error generated.
    error: the following command failed with exit code 1 but produced no further output
    CompileC
    /Users/davor/Library/Developer/Xcode/DerivedData/Runner-cnftrifzvgjcpyadycxyixuvtnnj/Build/Intermediates.noindex/Runner.build/Release-ipho
    neos/Runner.build/Objects-normal/arm64/GeneratedPluginRegistrant.o
    /Users/davor/Developer/Projects/Explovid/ios/Runner/GeneratedPluginRegistrant.m normal arm64 objective-c
    com.apple.compilers.llvm.clang.1_0.compiler
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Encountered error while building for device.

【问题讨论】:

  • Flutter 和 Firebase 是否已更新为支持 M1 Mac?

标签: ios firebase flutter apple-m1


【解决方案1】:

我有同样的问题。安装ffi并修复:

arch -x86_64 sudo gem install ffi

【讨论】:

    【解决方案2】:

    我发现有效的最佳答案是下面的 URL...我发现 M1 存在各种问题...需要确保您在“获取信息”对话框中使用 Rosetta 票证从终端运行。其复杂的过程。 https://github.com/GoogleCloudPlatform/ios-docs-samples/issues/43

    【讨论】: