如何修复错误“没有这样的模块“FirebaseAuth”

问题描述 投票:0回答:4

我安装了我需要的所有 Pod,但 Xcode 显示错误“没有这样的模块 FirebaseAuth”,我尝试了这个,发现:

  1. Shift+Command+K 清理工作区
  2. 我在终端中重新安装了 podfile
  3. Command + b
  4. 我已经在工作区中,而不是在项目文件中
  5. 我不知道这是否有帮助,但我重新安装了计算机。
import UIKit
import FirebaseAuth
import FirebaseDatabase
import FirebaseStorage

这是 Pod 文件:

target 'Ouvrigram' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

    pod 'Firebase/Core'
  pod 'Firebase/Database'
  pod 'Firebase/Storage'
  pod 'Firebase/Auth'
  # Pods for Ouvrigram

end

我安装了所有的 Pod,我检查了是否已安装,我不知道我要做什么,请帮忙。

swift firebase cocoapods
4个回答
4
投票

您确定目标名称与您的 Xcode 项目名称相同吗? 另请确保您使用 .xworkspace 文件打开项目。如果您使用的是 pod,则无法再使用 .xcodeproj 文件


1
投票

XCode 确实有很多问题,而且苹果对于提高其与 Google 服务的兼容性并不感到兴奋。即使导入后我也遇到同样的错误:

  • 导入 Firebase
  • 导入 FirebaseFirestore
  • 导入 FirebaseAuth
  • 导入 FirebaseFirestoreSwift

但是,尽管我的项目中到处都是红色错误,但我的项目仍成功构建并运行。 事实上,一个简单的“导入 Firebase”就足以成功构建。

XCode 版本 13.4.1 (13F100)


0
投票

尝试用 Podfile-ios-objc 替换 Podfile 的内容 https://github.com/flutter/flutter/blob/master/packages/flutter_tools/templates/cocoapods/Podfile-ios-objc

它对我有用。


0
投票

您是否在终端中运行了“pod init”命令?

© www.soinside.com 2019 - 2024. All rights reserved.