Firebase: Provided bucket does not match the Storage bucket of the current instance in Swift

Viewed 2769

I have the following code:

let storageRef = FIRStorage().reference(forURL: "gs://slugbug-....appspot.com") // dots intentional
let imageRef = storageRef.child("testImage.jpg")

But the app crashes and I get the following message:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Provided bucket: slugbug-....appspot.com does not match the Storage bucket of the current instance: (null)'

Even if I use

let storageRef = FIRStorage().reference()

The bucket is nil.

Why?

3 Answers
Related