Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/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
Android 获取令牌java.util.concurrent.TimeoutException时出错:在Flatter中使用FirebaseStorage时等待任务时超时| | |错误 我的问题_Android_Firebase_Flutter_Firebase Storage_Flutter Dependencies - Fatal编程技术网

Android 获取令牌java.util.concurrent.TimeoutException时出错:在Flatter中使用FirebaseStorage时等待任务时超时| | |错误 我的问题

Android 获取令牌java.util.concurrent.TimeoutException时出错:在Flatter中使用FirebaseStorage时等待任务时超时| | |错误 我的问题,android,firebase,flutter,firebase-storage,flutter-dependencies,Android,Firebase,Flutter,Firebase Storage,Flutter Dependencies,有人能帮我吗?我正在尝试将图像发送到firebase存储,然后检索下载URL并保存到firebasefirestore。但是我的FirebaseStorage方法显示了这个错误 E/StorageUtil(17801):获取令牌java.util.concurrent.TimeoutException时出错:等待任务时超时 在firebase存储:^4.0.0更新后发生 这是我的密码 我的Flatter应用程序中的FirebaseService类代码 static final FirebaseS

有人能帮我吗?我正在尝试将图像发送到firebase存储,然后检索下载URL并保存到firebasefirestore。但是我的FirebaseStorage方法显示了这个错误

E/StorageUtil(17801):获取令牌java.util.concurrent.TimeoutException时出错:等待任务时超时

在firebase存储:^4.0.0更新后发生

这是我的密码 我的Flatter应用程序中的FirebaseService类代码

static final FirebaseStorage storage = FirebaseStorage.instance;
static final FirebaseFirestore _firestore = FirebaseFirestore.instance;

Future<dynamic> sendData(SearchTileModel st, List<File> data) async {
 bool completed = false;
 CollectionReference _collec = _firestore.collection('Accounts Posts');
 List<String> _imageUrls = [];
 print(data.length);
 data.length > 0
     ? data.asMap().forEach((
         index,
         element,
       ) async {
         print(index);
         print(element);
         String downloadUrl;
///////  HERE this code doesn't get called up  ////////////
         StorageTaskSnapshot snapshot = await FirebaseStorage()
             .ref()
             .child("Accounts Posts/Images/${index}")
             .putFile(element)
             .onComplete
             .then((value) {
           downloadUrl = value.ref.getDownloadURL().toString();
           return;
         });
         print(downloadUrl);
         print(snapshot);
         print(snapshot.error);
         if (snapshot.error == null) {
           await snapshot.ref
               .getDownloadURL()
               .then((value) => downloadUrl = value.toString());
           print(downloadUrl);
           _imageUrls.insert(index, downloadUrl);
           if (st.images.length == _imageUrls.length) {
             SearchTileModel newModel = st;
             newModel.images = _imageUrls;
             await _collec
                 .doc('${newModel.placeName} : name')
                .set(
                  st.toJson(),
                  SetOptions(mergeFields: [
                    'images',
                  ]),
                )
                .whenComplete(() {
              return completed = true;
            }).catchError((onError) {
              print('${onError.toString()}');
              completed = false;
            });
          }
        } else {
          completed = false;
          print('Error from image repo ${snapshot.error.toString()}');
          throw ('This file is not an image');
        }
      })
    : print('No Images Selected');
if (data.length == 0) {
  SearchTileModel newModel = st;
  newModel.images = _imageUrls;
  await _collec
      .doc('${newModel.placeName} : name')
      .set(
        st.toJson(),
        SetOptions(mergeFields: [
          'images',
        ]),
      )
      .whenComplete(() {
    return completed = true;
  }).catchError((onError) {
    print('${onError.toString()}');
    completed = false;
  });
}
return completed;
}
  I/flutter (14005): true
  I/flutter (14005): redtfgn
  I/flutter (14005): File: 
  '/storage/emulated/0/Android/data/com.example.medium/files/Pictures/scaled_ec614e8a-0522-4cae-97be- 
  3ed50356de9c3343447263121135351.jpg'
  I/flutter (14005): 1
  I/flutter (14005): running
  I/flutter (14005): 0
  I/flutter (14005): File: 
  '/storage/emulated/0/Android/data/com.example.medium/files/Pictures/scaled_ec614e8a-0522-4cae-97be- 
  3ed50356de9c3343447263121135351.jpg'
  I/flutter (14005): Till Here the code is Running
  I/BiChannelGoogleApi(17801): [FirebaseAuth: ] getGoogleApiForMethod() 
  returned Gms: com.google.firebase.auth.api.internal.zzaq@cdf79f2
  E/StorageUtil(17801): error getting token 
  java.util.concurrent.TimeoutException: Timed out waiting for Task
  D/NetworkSecurityConfig(17801): No Network Security Config specified, using 
  platform default
  W/NetworkRequest(17801): no auth token for request