【问题标题】:Flutter: 'GoogleUtilities/GULAppEnvironmentUtil.h' file not foundFlutter:找不到“GoogleUtilities/GULAppEnvironmentUtil.h”文件
【发布时间】:2021-05-14 19:57:27
【问题描述】:

颤振 - 我试图为我的颤振应用程序运行 firebase auth 进行用户身份验证,但我遇到了很多错误。目前,我遇到了“致命错误:找不到‘GoogleUtilities/GULAppEnvironmentUtil.h’文件”问题 #import '

你能帮帮我吗?我错过了什么?

下面是我的 podfile.lock

PODS:
  - Firebase/Analytics (3.6.0):
    - FirebaseAnalytics (= 3.4.2)
  - Firebase/Auth (7.3.0):
    - Firebase/CoreOnly
    - FirebaseAuth (~> 7.3.0)
  - Firebase/CoreOnly (7.3.0):
    - FirebaseCore (= 7.3.0)
  - firebase_auth (0.20.0-1):
    - Firebase/Auth (= 7.3.0)
    - firebase_core
    - Flutter
  - firebase_core (0.7.0):
    - Firebase/CoreOnly (= 7.3.0)
    - Flutter
  - FirebaseAnalytics (3.4.2):
    - FirebaseInstanceID (~> 1.0)
    - GoogleInterchangeUtilities (~> 1.2)
    - GoogleSymbolUtilities (~> 1.1)
    - GoogleUtilities (~> 1.2)
  - FirebaseAuth (7.3.0):
    - FirebaseCore (~> 7.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GTMSessionFetcher/Core (~> 1.4)
  - FirebaseCore (7.3.0):
    - FirebaseCoreDiagnostics (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/Logger (~> 7.0)
  - FirebaseCoreDiagnostics (7.6.0):
    - GoogleDataTransport (~> 8.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/Logger (~> 7.0)
    - nanopb (~> 2.30907.0)
  - FirebaseInstanceID (1.0.9)
  - Flutter (1.0.0)
  - GoogleDataTransport (8.2.0):
    - nanopb (~> 2.30907.0)
  - GoogleInterchangeUtilities (1.2.2):
    - GoogleSymbolUtilities (~> 1.1)
  - GoogleSymbolUtilities (1.1.2)
  - GoogleUtilities (1.3.2):
    - GoogleSymbolUtilities (~> 1.1)
  - GoogleUtilities/AppDelegateSwizzler (7.2.2):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (7.2.2):
    - PromisesObjC (~> 1.2)
  - GoogleUtilities/Logger (7.2.2):
    - GoogleUtilities/Environment
  - GoogleUtilities/Network (7.2.2):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (7.2.2)"
  - GoogleUtilities/Reachability (7.2.2):
    - GoogleUtilities/Logger
  - GTMSessionFetcher/Core (1.5.0)
  - nanopb (2.30907.0):
    - nanopb/decode (= 2.30907.0)
    - nanopb/encode (= 2.30907.0)
  - nanopb/decode (2.30907.0)
  - nanopb/encode (2.30907.0)
  - PromisesObjC (1.2.12)

DEPENDENCIES:
  - Firebase/Analytics
  - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
  - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
  - Flutter (from `Flutter`)


PODFILE CHECKSUM: bc1d24e77f14f92074f70a556e48b173f43f1d27

COCOAPODS: 1.10.1

【问题讨论】:

    标签: firebase flutter firebase-authentication flutter-dependencies


    【解决方案1】:

    首先确保您添加了 google 服务 plist 并尝试使用终端

    吊舱解体

    Pod 设置

    Pod 安装

    颤动运行
    如果没有

    然后

    关闭xcode

    先添加到

    Pod 文件

    pod 'Firebase/Analytics'

    pod 'Firebase/Auth'

    pod 'Firebase/Core'

    pod 'Firebase/Messaging'

    pod 'Firebase/Storage'

    pod 'Firebase/Firestore'

    然后去终端

    吊舱解体

    Pod 设置

    Pod 安装

    颤动运行

    然后应该可以正常工作

    之后使用 xcode

    【讨论】:

      【解决方案2】:

      在您的 Podfile 中,将所有与 Firebase 相关的 pod 声明移动到带有 target 'Runner' do 的行的正下方。
      移动意味着从它们现在所在的任何地方删除它们,并完全按照此处描述的方式放置它们。

      之后,目标看起来有点像这样:

      目标“跑步者”做
      pod 'Google-Mobile-Ads-SDK', '~> 7.69.0'
      pod 'Firebase/Analytics'
      使用_frameworks!
      使用_modular_headers!

      flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
      结束

      运行之后:

      cd ios(从你的项目根目录)

      颤振干净
      rm -fr Pods Podfile.lock
      pod 缓存清理 --all
      颤振酒吧获得
      吊舱更新

      并尝试再次构建您的应用

      您可能还需要将 firebase_analytics 包添加到您的 pubspec.yaml 中,即使您没有在代码中明确使用它(可能有一些解决方法可以消除这样做的需要,但我不知道该怎么做那个)。

      这是我的 pubspec 的摘录,其中包含与 Firebase 相关的条目

      firebase_core:^1.0.3
      firebase_analytics:^7.1.1

      奇怪的是,iOS 编译会失败并出现以下情况: fatal error: 'GoogleUtilities/GULURLSessionDataResponse.h' file not found #import <GoogleUtilities/GULURLSessionDataResponse.h> 如果我删除 firebase_analytic 包

      【讨论】:

      • 我面临 'GoogleUtilities/GULURLSessionDataResponse.h' 文件未找到 #import 错误。你知道怎么解决吗?
      • 你找到解决办法了吗?
      【解决方案3】:

      耐心地查看您的Podfile.lock 文件并检查您的Google* 和Firebase* pod 的已安装版本。在我的情况下,当所有其他 Firebase pod 的主要版本为 8 时,FirebaseAnalytics 的版本为 3.6.2。然后查看依赖项(谁使用这个 pod 的小版本)并尝试找到哪个 pod 带来你错了版本。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-06-22
        • 2016-07-21
        • 2020-05-02
        • 2022-01-17
        • 2020-11-04
        • 1970-01-01
        • 2021-09-01
        • 2021-08-27
        相关资源
        最近更新 更多