简体   繁体   English

错误存储/未知上传图片到 Firebase 存储

[英]Error storage/unknown uploading picture to Firebase Storage

Faced this error while working on a new React-Native project and using React-Native-Firebase library.在处理新的 React-Native 项目并使用 React-Native-Firebase 库时遇到此错误。 Followed all tutorial setup steps and got this error.按照所有教程设置步骤进行操作并遇到此错误。 It's likely that this error can be faced in not react-native projects as well.在 not react-native 项目中也可能会遇到此错误。

I've spent so many hours trying to fix it and didn't find a solution to my problem on stackoverflow. 我花了很多时间试图修复它,却没有找到解决我的stackoverflow问题的解决方案。

Turns out, the solution was as simple as going to Firebase Console => Storage => click Getting started which creates default Storage rules. 事实证明,该解决方案非常简单,只需转到Firebase Console => Storage =>单击入门即可创建默认的存储规则。

It was a new project and no storage rules existed. 这是一个新项目,不存在存储规则。

Solution was found by running adb logcat command, output showed something like check security rules for firebase storage and no permission for storage 通过运行adb logcat命令找到了解决方案,输出显示类似于check security rules for firebase storage并且no permission for storage

Hope this will save you hours debugging I wasted! 希望这样可以节省您调试我浪费的时间!

就我而言,问题是我设置了错误的存储桶 URL ( something.firebaseapp.com ),而它本应是something.appspot.com

Just make the rules of your firebase storage to be true ie allow read and write to be true.只需使您的 firebase 存储的规则为真,即允许读取和写入为真。 That will do the trick.这样就可以了。 Like this像这样

rules version = '2';
 service firebase.storage {
   match /b/{bucket}/o {
   match /{allPaths=**} {
    allow read, write: if true;
  }
 }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 firebase存储出错是否可以继续上传? - Can I resume the uploading if an error occurs in firebase storage? 在 Flutter Web 上使用 firebase_storage 4.0.0 将图像上传到 Firebase 存储? - Uploading an Image to Firebase Storage with firebase_storage 4.0.0 on Flutter Web? 从firebase函数上传数据到firebase存储? - Uploading data from firebase functions to firebase storage? 无法查看firebase存储中的图片 - I can't view the picture in the firebase storage 如何从 firebase 存储中加载图片到 recyclerview? - How to load in a picture from firebase storage into recyclerview? 上传文件到firebase存储结果在null - Uploading file to firebase storage results in null 将视频上传到本机反应中的 firebase 存储 - uploading video to firebase storage in react native 未处理的异常:[firebase_storage/unknown] 发生未知错误,请检查服务器响应 - Unhandled Exception: [firebase_storage/unknown] An unknown error occurred, please check the server response flutter: [firebase_storage/unknown] 发生未知错误,请检查服务器响应 - flutter: [firebase_storage/unknown] An unknown error occurred, please check the server response 将图像 URL 从 firebase 存储上传到 firebase 数据库时出现错误 - I am getting an error while uploading image URL to firebase database from the firebase storage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM