Firebase 存储上传错误:FIRStorageErrorDomain 代码=-13000

GFV*_*450 2 storage firebase swift

我正在尝试将图像上传到 Firebase,实际上我昨天成功了几次,但今天我收到了这个错误:

可选 - Some : Error Domain=FIRStorageErrorDomain Code=-13000 “发生未知错误,请检查服务器响应。” UserInfo={ResponseErrorDomain=FIRStorageErrorDomain, object=ProfileImages/ascascasc ascas.jpg, error_name=ERROR_USER_NOT_FOUND, bucket=ichallenge-c52ae.appspot.com, ResponseErrorCode=-13020, NSLocalizedDescription=发生未知错误,请检查服务器响应。}

我想重申:昨天和今天之间的代码没有任何变化,它只是停止工作。这是代码,我用注释突出显示了它发生的行:

@IBAction func signUpButtonPressed(sender: AnyObject)
{
    // If textfields have more than 3 characters
    if firstNameTextField.text!.characters.count > 3 && passwordTextField.text!.characters.count > 3 && emailTextField.text!.containsString("@")
    {
        createUser()

        //Goes to Main Storyboard
        parseOutdated.signUpInBackgroundWithBlock { (success: Bool, error: NSError?) in
            NSNotificationCenter.defaultCenter().postNotificationName("Login", object: nil)

        }
    }
    else
    {
        firstNameShake.shakeAnimation()
        lastNameShake.shakeAnimation()
        passwordShake.shakeAnimation()
        emailShake.shakeAnimation()
    }
}

func createUser()
{
    //Unwrap optionals before pushing to Firebase Database
    let name: String = "\(self.firstNameTextField.text!) \(self.lastNameTextField.text!)"

    storeProfileImage(name)
}

func storeProfileImage(name: String)
{
    let profileImageData = UIImageJPEGRepresentation(self.profileImageView.image!, 1.0)

    // Create a reference to the file you want to upload
    let profileImageRef = storageRef.child("ProfileImages/\(name).jpg")

    // Upload the file to the path defined above
    profileImageRef.putData(profileImageData!, metadata: nil) { metadata, error in
        if (error != nil) //ERROR HAPPENS HERE
        {
            print("Image not stored: ", error?.localizedDescription)
        }
        else
        {
            //Stores the profile image URL and sends it to the next function
            let downloadURL = metadata!.downloadURL()
            self.storeUserData(name, profileImageURL: downloadURL!)
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这是 XCode 中断点的屏幕截图:

我不明白为什么错误会显示“ERROR_USER_NOT_FOUND”,因为我根本没有尝试进行身份验证

提供的任何帮助将不胜感激。

小智 5

如果您在未退出应用的情况下使用同一用户进行测试,则您的身份验证令牌可能已过期。尝试注销冷杉