[英]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.