我有以下代码:
let storageRef = FIRStorage().reference(forURL: "gs://slugbug-....appspot.com") // dots intentional
let imageRef = storageRef.child("testImage.jpg")
但是应用程序崩溃了,我收到以下消息:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Provided bucket: slugbug-....appspot.com does not match the Storage bucket of the current instance: (null)'
即使我用
let storageRef = FIRStorage().reference()
桶为零。
为什么?
最佳答案
您缺少 .storage()
。
检查你的线路。应该是:
let storageRef = FIRStorage.storage().reference(forURL: "gs://slugbug-....appspot.com") // dots intentional
希望对你有帮助
关于ios - Firebase:提供的存储桶与 Swift 中当前实例的存储桶不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44253124/