【问题标题】:Importing FirebaseAnalytics module instead of Firebase导入 FirebaseAnalytics 模块而不是 Firebase
【发布时间】:2016-12-01 23:50:15
【问题描述】:

我正在研究 Google Analytics,Google 说我需要安装 Firebase 来处理 Google Analytics 操作。

我通过 Cocoapods 安装了 Firebase,并导入了 firebase.google.com 提供的属性列表 (.plist) 文件。

但是当我尝试通过 import Firebase 导入 Firebase 模块时,Xcode 说没有这样的模块并且自动完成建议 import FirebaseAnalytics

如果我使用 FirebaseAnalytics 模块,我会收到如下所示的错误。我查看了this 问题,但没有一个答案能解决我的问题。

Pod 文件:

# Uncomment this line to define a global platform for your project
 platform :ios, '8.0'


target 'MyApp do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  # Pods for MyApp
    pod 'Firebase/Core'

  target 'MyAppTests' do
    pod 'Firebase/Core'
    inherit! :search_paths
    # Pods for testing
  end

  target 'MyAppUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

【问题讨论】:

    标签: swift firebase cocoapods firebase-analytics


    【解决方案1】:

    尝试清理您的派生数据文件夹。 (See this article for help.) 此外,移除 pod 并重新添加它可能会有所帮助。 :)

    顺便说一句:你在 AppDelegate.swift 中实现了FIRApp.configure() 吗?

    【讨论】:

    • 还有多个关于linker command failed with exit code 1的话题。
    • 我已经尝试重新安装 pod。而且我只使用 import FirebaseAnalytics 实现了 FIRApp.configure() 并且导致链接器命令失败错误。
    • 看看是否也将“Firebase”添加到您的 podfile 中会有所不同。
    • 我尝试只使用 import 'Firebase',但没有任何意义。最后,我在不使用 Coocapods 的情况下添加了框架。
    • 当然可以。 :D 有人不喜欢 cocoapods。
    猜你喜欢
    • 2013-04-05
    • 1970-01-01
    • 2022-06-18
    • 1970-01-01
    • 2017-04-12
    • 1970-01-01
    • 1970-01-01
    • 2019-02-18
    • 1970-01-01
    相关资源
    最近更新 更多