ios - 在 Swift 中使用 Firebase - pod 安装错误

标签 ios swift firebase google-cloud-firestore

我目前正在编写一个 Swift 应用程序来使用 Firebase,这只是 YouTube 上的一门类(class)。我创建了一个 PodFile 来尝试安装 Firebase 库:

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

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

  # Pods for FirestoreDemo

  # add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'
  pod 'Firebase/Core'

  pod 'Firebase/Firestore' 
  # https://firebase.google.com/docs/ios/setup#available-pods

end

当我从 PodFile 中删除 pod“Firebase/Firestore”行时 - pod install 有效。

当我输入并运行 pod install 时 - 它会尝试将 BoringSSL 安装为依赖项。我根本无法让 pod install 工作。我尝试下载 BoringSSL 并手动安装。我创建了一个 podspec 文件并尝试将 Firestore 指向该文件:

pod 'Firebase/Firestore', :podspec => 'FireStore.podspec.json'

似乎没有什么对我有用,花了几个小时试图解决这个问题。

我在网上阅读的所有内容都无济于事,似乎没有任何效果。

谢谢。

最佳答案

我没有看到您的 pod 文件有任何问题:

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

target 'FirestoreDemo' do 
    # Comment the next line if you don't want to use dynamic frameworks use_frameworks!
    # Pods for FirestoreDemo
    # add the Firebase pod for Google Analytics 
    pod 'Firebase/Analytics' 
    pod 'Firebase/Core'
    pod 'Firebase/Firestore' 
    # https://firebase.google.com/docs/ios/setup#available-pods
end

尝试运行 pod repo update 以确保您拥有可用的最新 pod,然后再次尝试运行 pod install

我刚刚在一个全新的项目上运行了相同的 pod install,它没有问题,但确实花了一点时间。 (请参阅下面它安装的依赖项,其中一些依赖项需要一段时间,具体取决于互联网速度等......) 以下是安装 podfile 中的 3 个 pod 时安装的依赖项/pods 的日志: enter image description here

关于ios - 在 Swift 中使用 Firebase - pod 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58085601/

相关文章:

objective-c - UIViewController purgeMemoryForReason : Crashing on iOS 5

ios - UIAppearance Swift 4

swift - 在 Swift 中获取 ioctl 数字

ios - 如何在 PDFKit 中突出显示搜索结果 - iOS

ios - 将数据嵌套到 firebase 中的每个 UID

firebase - Flutter:无法使用静态访问访问实例成员 'signInWithGoogle'。 (static_access_to_instance_member 在)

ios - Webapp 在 ipad air 上无法正常显示

ios - 完整世界 GeoJson 未出现在 Google 地球 iOS API 中

java - 如何找到调试 SHA 1 key

javascript - iOS 媒体播放器和 javascript 重定向