【问题标题】:Xcode Build failed,fatal error: module 'firebase_auth' not found @import firebase_auth;Xcode Build failed,fatal error: module 'firebase_auth' not found @import firebase_auth;
【发布时间】:2020-10-16 12:08:11
【问题描述】:
    Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.46.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

\\\错误信息

     ** BUILD FAILED **
Xcode's output:
↳
    /Users/Razi/Desktop/projects/Sayy/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'firebase_auth' not found
    @import firebase_auth;
     ~~~~~~~^~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

我尝试删除 Podfile/Podlock 并运行 pod init/ pod install,但没有成功。还查看了 GitHub repo for ios 文件夹。为什么没有找到 firebase_auth?

【问题讨论】:

    标签: ios xcode macos flutter cocoapods


    【解决方案1】:

    更新:我最终能够通过执行以下操作找到解决方法:

    1. 运行Flutter Clean(在项目的ios文件夹中)
    2. 同时删除 PodlockPod Folder
    3. 运行pod init,后跟pod install

    似乎是 runner.xcworkspace 文件夹和构建的问题 运行构建所需的文件。

    【讨论】:

      【解决方案2】:

      我尝试按照建议的步骤执行 Flutter clean,手动删除 podfilepodfile.lock 以及 Pod 相关文件夹,再次执行 pod install 等等 - 没有任何帮助。

      最后帮助我的是以下顺序:

      1. 使用pubspec.yaml 中声明的相同依赖项创建一个新项目。
      2. 在新项目中运行pub get
      3. 在新项目中运行 pod install 以生成所有内容
      4. 将新生成的podfilepodfile.lock 文件复制到旧项目中。
      5. 在旧项目中运行pod install

      只有在这个序列之后,我才能再次构建 iOS 项目。

      【讨论】:

      • 怪物!经过长时间的研究,我可以恢复安装的唯一方法
      • 我正面临这个问题,但找不到任何解决方案尝试了所有步骤
      【解决方案3】:
      1. 您似乎没有提供完整的 Podfile 内容(我在那里看不到有关 Sayy 目标的任何信息)或者您一直在更改 Podfile

      2. 根据您尝试归档的内容,删除 Podfile 中的最后 3 行或将行“pod 'AFNetworking', '~> 3.0'”移动到“use_modular_headers!”之后的目标“Runner”

      3. 在左侧边栏中打开 XCode 最上面的项目(蓝色图标)-> 在最左侧的菜单中,您将看到两个部分 - 项目和目标。因此,“targets”块中的名称是唯一可以出现在 Podfile 中关键字“target”之后的名称

      4. 一切都取决于:

      • 您需要 AFNetworking 吗?
      • 您的应用程序中有哪些目标

      【讨论】:

        【解决方案4】:
        These steps helped me to resolve the issue completely for IOS:
        >> flutter clean
         then "delete podfile, podfile.lock, pod folder"
        >> flutter pub get
        >> pod install
        >> flutter run
        

        【讨论】:

          【解决方案5】:

          在构建设置中更改 ios 的部署目标-> 在 xcode 或 podfile 中部署设置部署目标大于 10

          【讨论】:

            【解决方案6】:

            我已经摆脱了这个问题,购买取消注释 Podfile 中的行

             platform :ios, '10.0'
            

            同时删除清理你的项目并重新构建!

            【讨论】:

              【解决方案7】:

              这对我有用

              1. 在 pub.dev 上查找最新版本的 firebase_core / firebase_auth
              2. 清除ios文件夹中的Pods/Podfile.lock
              3. ios 文件夹中运行pod install --repo-update(重要!)

              【讨论】:

                猜你喜欢
                • 1970-01-01
                • 2021-05-24
                • 2021-10-01
                • 2020-09-05
                • 2018-02-23
                • 2018-08-29
                • 2015-11-26
                • 2020-03-08
                • 2021-12-02
                相关资源
                最近更新 更多