Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase (颤振)Can';t使用云存储下载图像_Firebase_Flutter_Google Cloud Storage_Firebase Storage - Fatal编程技术网

Firebase (颤振)Can';t使用云存储下载图像

Firebase (颤振)Can';t使用云存储下载图像,firebase,flutter,google-cloud-storage,firebase-storage,Firebase,Flutter,Google Cloud Storage,Firebase Storage,我得到这个错误: E/StorageUtil(21342): error getting token java.util.concurrent.ExecutionException: com.google.firebase.internal.api.FirebaseNoSignedInUserException: Please sign in before trying to get a token. W/NetworkRequest(21342): no auth token for requ


我得到这个错误:

E/StorageUtil(21342): error getting token java.util.concurrent.ExecutionException: com.google.firebase.internal.api.FirebaseNoSignedInUserException: Please sign in before trying to get a token.
W/NetworkRequest(21342): no auth token for request

当我从执行此代码时(从具有Firestore存储的图像获取下载url):


这不是因为我的firestore规则,因为我已将其设置为公共,如下所示:

此外,我不认为这是由于互联网连接,因为我能够从Firebase云数据库加载字段。
你有解决办法吗?非常感谢

我设法获得了我的url图像
方法如下:

  • 将SAH-1认证添加到您的项目firebase中,并将新的google服务文件上载到您的项目中
  • 在调用.getDownloadUrl()之前,让您的用户匿名登录(并在firebase项目中启用它)
  •  Future _getImageUrl() async {
        final ref = FirebaseStorage.instance.ref().child('lake');
        var url = await ref.getDownloadURL();
        return url;
      }
    
    rules_version = '2';
    service firebase.storage {
      match /b/{bucket}/o {
        match /{allPaths=**} {
          allow read, write;
        }
      }
    }