xcode (Swift) '使用未解析的标识符'FIRStorage'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38561257/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:04:26  来源:igfitidea点击:

(Swift) 'use of unresolved identifier 'FIRStorage'

iosswiftxcodefirebasefirebase-storage

提问by evanhaus

I am using firebase and I have the following line of code:

我正在使用 firebase 并且我有以下代码行:

let storageRef = FIRStorage.storage().reference()

which gives me the error 'use of unresolved identifier 'FIRStorage'.

这给了我错误'使用未解析的标识符'FIRStorage'。

These are my imports in my file:

这些是我在文件中的导入:

import UIKit
import Firebase

In the video tutorial I am following the person in the video only has these two imports and gets no error. 'FIRStorage' also seems to be an actual class in the Firebase documentation. Is there an import I am missing? Is there something wrong with my frameworks or podfile?

在视频教程中,我正在关注视频中的人只有这两个导入并且没有错误。“FIRStorage”似乎也是 Firebase 文档中的一个实际类。是否有我缺少的导入?我的框架或 podfile 有问题吗?

Here are my pods:

这是我的豆荚:

enter image description here

在此处输入图片说明

Any help is greatly appreciated!

任何帮助是极大的赞赏!

采纳答案by ?inh Quang Hi?u

You need install FirebaseStorage to use it

您需要安装 FirebaseStorage 才能使用它

Follow this instruction: https://firebase.google.com/docs/storage/ios/start

按照此说明操作:https: //firebase.google.com/docs/storage/ios/start

回答by Mahyar

You need to the following steps:

您需要执行以下步骤:

  1. import FirebaseStorage
  2. FIRStorage has been renamed to Storage
  1. 导入 FirebaseStorage
  2. FIRStorage 已重命名为 Storage

Hopefully you find it helpful.

希望你觉得它有帮助。