You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

FIRStorageErrorDomain Code=-13010:UIImageView未加载,控制台提示对象不存在

Fixing FIRStorageErrorDomain Code=-13010 ("Object images does not exist")

Hey there, let's work through why you're hitting this Firebase Storage error and get your UIImageView populated with the image.

1. Break Down the Error

That -13010 code maps directly to StorageErrorCode.objectNotFound — Firebase can't find the object you're trying to download. The message "Object images does not exist" gives us two key clues:

  • You're pointing to a storage path that doesn't actually exist in your bucket
  • Or you're trying to download a folder instead of a specific image file (Firebase Storage doesn't support downloading entire folders directly)

2. Fix the Path Issues in Your Code

Looking at your snippet, there are two clear missteps:

  • You define gsReference pointing to post-pics/ but never use it — instead, you use storageRef.child("images/"), which likely points to the root of your bucket, not the post-pics subdirectory you intended.
  • You're targeting the images/ folder itself, not a specific image file inside it.

Here's the corrected code, with comments explaining the changes:

// Download image
let storage = Storage.storage()
// Point to your intended base directory: post-pics/
let postPicsRef = storage.reference(forURL: "gs://myaddress.appspot.com/post-pics/")
// Target a specific image file inside the images folder (replace with your actual filename)
let imageStorageRef = postPicsRef.child("images/your-image-filename.jpg")

imageStorageRef.getData(maxSize: 2 * 1024 * 1024) { data, error in
    if let error = error {
        print("******** \(error)")
    } else {
        // Don't forget to assign the image to your UIImageView!
        if let image = UIImage(data: data!) {
            yourImageView.image = image
        }
    }
}

3. Quick Verification Steps

  • Double-check your Firebase Storage console: Confirm the path post-pics/images/your-image-filename.jpg exists. If the folder or file is missing, upload it first.
  • Make sure yourImageView is properly connected to your storyboard/XIB (or initialized programmatically) — otherwise, even a successful download won't show anything.
  • If you're using storageRef elsewhere, confirm it's initialized correctly. For the default bucket, Storage.storage().reference() works, but always chain in subdirectories like post-pics/ to target the right location.

内容的提问来源于stack exchange,提问作者user9210345

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:55:29