【问题标题】:Why am I getting the error 'No such module FirebaseUI' in swift?为什么我在 swift 中收到错误“没有这样的模块 FirebaseUI”?
【发布时间】:2021-09-07 04:14:41
【问题描述】:

每次我尝试构建时都会收到错误消息“没有这样的模块 FirebaseUI”

我尝试过的事情:

  • 清除派生数据
  • 运行“pod update”以确保所有依赖项都是最新的
  • arch -x86_64 pod install 运行我的安装
  • 确保通过打开 .xcworkspace 而不是 .xcodeproj 来运行应用程序
  • 清理我的构建文件夹(Command+Shift+K)
  • 删除我的项目并从 Git 重新下载
  • 将 FirebaseUI 框架直接添加到我的项目中
  • 将 Scheme 更改为 FirebaseCore 允许项目构建,但模拟器不会打开进行测试,也不会在物理设备上运行。
  • 运行 pod deintegrate && pod install,我注意到该命令确实提到了 FirebaseUI 已包含在内并且版本为 11.03
  • 在 Rosetta 中运行 xcode

我正在使用 M1 芯片的新 MacBook Pro 上运行这个项目。以前,我的项目在较旧的英特尔芯片上运行良好。我的 Xcode 版本是 12.5.1,我的操作系统是 11.4

这是我的 pod 文件:

# Uncomment the next line to define a global platform for your project
 platform :ios, '12.0'

post_install do |pi|
    pi.pods_project.targets.each do |t|
      t.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
      end
    end
end

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

  # Fixed Pod configuration
  # Pods for Pikit
  pod 'Firebase'
  pod 'Firebase/Storage'
  pod 'Firebase/Auth'
  pod 'Firebase/Firestore'
  pod 'Firebase/Functions'
  pod 'Firebase/Analytics'
  pod 'Firebase/Messaging'
  pod 'Firebase/DynamicLinks'
  pod 'FirebaseUI/Auth'
  pod 'FirebaseUI/Email'
  pod 'FirebaseUI/Google'
  pod 'FirebaseUI/OAuth' # Used for Sign in with Apple, Twitter, etc
  
  # Other Podfiles
  pod 'OnboardKit'
  # Auto move screen for keyboard
  pod 'SDWebImage'
  pod 'PureLayout'
  pod 'IQKeyboardManagerSwift'
  pod 'Google-Mobile-Ads-SDK'


  
end

编辑

之前选择的答案工作了一段时间,但在更改了不相关 pod 的版本后,应用程序显示了同样的问题。

【问题讨论】:

    标签: ios swift firebase cocoapods firebaseui


    【解决方案1】:

    FirebaseUI 版本 11 现在已分解为子模块,因此您需要导入单个模块(例如 import FirebaseAuthUI),而不是之前仅使用 import FirebaseUI。或者指示您的 Podfile 使用旧版本。

    来自FirebaseUI 11.0.0 release notes

    重大变化:将整体 FirebaseUI 模块拆分为每个功能的单独模块。您需要相应地更新项目中的导入。

    // FirebaseUI 10.x
    import FirebaseUI
    // FirebaseUI 11
    import FirebaseAuthUI
    import FirebaseDatabaseUI
    // ...
    

    【讨论】:

    • 我认为这行得通,但现在我收到了这篇文章中描述的错误:stackoverflow.com/questions/68085529/…
    • 通过将我的 pod 文件更改为 pod 'FirebaseUI', '~> 10.0.2' 我解决了我的问题。
    【解决方案2】:

    我推荐你在x86架构下运行pod install命令,因为我看到原生运行这个命令会带来一些问题,试试:

    arch -x86_64 pod install
    

    【讨论】:

      【解决方案3】:

      我找到了解决方案,但我将保持开放状态,因为我不确定它是否是永久解决方案/不确定它为什么会起作用。这与较早的答案之一直接冲突。我删除了除基础之外的所有 FirebaseUI 豆荚,因此我与火基地相关的豆荚仅包含以下内容:

        pod 'Firebase'
        pod 'Firebase/Storage'
        pod 'Firebase/Auth'
        pod 'Firebase/Firestore'
        pod 'Firebase/Functions'
        pod 'Firebase/Analytics'
        pod 'Firebase/Messaging'
        pod 'Firebase/DynamicLinks'
        pod 'FirebaseUI'
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-02-13
        • 2018-12-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-10-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多