Flutter 不会在 iOS 上使用 Firebase 在 M1 Mac 上构建

时间:2021-03-08 23:51:13

标签: ios firebase flutter apple-m1

我一直尝试在 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.

2 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。已安装 ffi 并已修复:

arch -x86_64 sudo gem install ffi

答案 1 :(得分:-1)

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