首页 > 解决方案 > 获取 W/NetworkRequest:使用 Firebase 存储时发送网络请求 POST 时出错

问题描述

问题是什么时候

I try to upload an image to firebase storage sometimes it successfully uploads the image but most of the time it keep saying



 *****/com.example.firebasestoragedemo W/NetworkRequest: error sending network request POST https://firebasestorage.googleapis.com/*myproject_name/some_more_extension.
when I enter to this link I found 
{
  "error": {
    "code": 403,
    "message": "Permission denied. Could not perform this operation"
  }
}
but I have enabled signInWithEmailAndPassword in my onStart(){...} function and my security rule is here
rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write : if request.auth != null;
    }
  }
}*****

我得到这两个例外..

java.net.ConnectException:无法连接到 firebasestorage.googleapis.com/....

我的代码确实是最新的,否则有时无法正常工作。我认为问题可能出在 Firebase 的其他地方。

请帮帮我。如果您尝试提供帮助,将非常高兴。谢谢

标签: firebaseandroid-studiofirebase-realtime-databasefirebase-authenticationfirebase-storage

解决方案


当我尝试通过移动数据访问“Firebase Storage”时遇到同样的问题。(来自孟加拉国)。然后我通过宽带互联网连接进行了尝试,一切正常。


推荐阅读