firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.44k stars 3.91k forks source link

Lost connection to device in desktop flutter app Firebase Storage ! #12743

Closed Hmida71 closed 1 week ago

Hmida71 commented 2 weeks ago

Is there an existing issue for this?

Which plugins are affected?

Storage

Which platforms are affected?

Windows

Description

ERORR : Service protocol connection closed. [ +2 ms] Lost connection to device. [ +2 ms] DevFS: Deleting filesystem on the device (file:///C:/Users/hmida/AppData/Local/Temp/elguide_logiciel68943f4b/elguide_logiciel/) [ +266 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed

[ +4 ms] "flutter run" took 37,777ms. [ +235 ms] ensureAnalyticsSent: 230ms [ +1 ms] Running 1 shutdown hook [ +15 ms] Shutdown hooks complete [ ] exiting with code 0

Code :

Future<List<String>> uploadImages(List<File> imageFiles, String path) async {
    final imagesUrlArray = <String>[];
    for (final imageFile in imageFiles) {
      try {
        final imageName = generateUniqueFileName(imageFile);
        final uploadTask = FirebaseStorage.instance.ref('$path/$imageName').putFile(imageFile);
        final snapshot = await uploadTask;
        final imageUrl = await snapshot.ref.getDownloadURL();
        imagesUrlArray.add(imageUrl);
      } on FirebaseException catch (e) {
        debugPrint("UploadImages FirebaseException Error: $e");
      } catch (e) {
        debugPrint("UploadImages Error: $e");
      }
    }
    return imagesUrlArray;
  }

no print app closed directly !!

Reproducing the issue

Lost connection to device in desktop flutter app in Firebase Storage ! isuss in this line : final uploadTask = FirebaseStorage.instance.ref('$path/$imageName').putFile(imageFile);

Firebase Core version

2.30.1

Flutter Version

3.19.5

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Replace this line with the contents of your `flutter pub deps -- --style=compact`. ```

Additional context and comments

No response

russellwheatley commented 2 weeks ago

I have a PR for fixing some Windows Storage bugs here: https://github.com/firebase/flutterfire/pull/12723

It ought to fix your issues.

ahmeedev commented 2 weeks ago

I'm Facing this same exact issue 😭

Shuusan commented 1 week ago

It's not only in storage; I'm also facing the same issue when calling a simple get function from the cloud_firestore library, like this:

FirebaseFirestore.instance.collection('printer_properties').doc(machineName).get();

However, when I tested it on a different PC, it ran without any problems. I'm wondering if this could be related to the PC specs, or if there's something in the Windows settings that needs to be enabled.