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.66k stars 3.96k forks source link

[storage]: Unknown Error (Message too long) while uploading image on iOS #12973

Closed ahmadexe closed 3 months ago

ahmadexe commented 3 months ago

Is there an existing issue for this?

Which plugins are affected?

Storage

Which platforms are affected?

iOS

Description

[storage]: Unknown Error (Message too long) while uploading image on iOS

Description

While uploading images to firebase storage from flutter ios project the images are sometimes uploaded to the storage however sometimes the images are not uploaded and we are stuck with a message that says; "Unhandled Exception: [firebase_storage/unknown] The operation couldn’t be completed. Message too long"

Flutter doctor Output

Screenshot 2024-06-18 at 4 21 21 PM

Flutter doctor -v output

Screenshot 2024-06-18 at 4 22 07 PM

Reproducing the issue

Unable to identify the exact steps to reproduce the issue,

final refRaw = FirebaseStorage.instance.ref();
final ref = refRaw.child(name);
final uploadTask = await ref.putFile(file); // Line that produces the error
final downloadUrl = await uploadTask.ref.getDownloadURL();
return downloadUrl;

Line no. 3 sometimes fail with the error code: [firebase_storage/unknown] and error message: The operation couldn’t be completed. Message too long

Firebase Core version

2.15.0

Flutter Version

3.19.6

Relevant Log Output

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [firebase_storage/unknown] The operation couldn’t be completed. Message too long
Lyokone commented 3 months ago

Hello @ahmadexe, can you try the latest version of core + storage to see if you are still having the issue? Thanks

ahmadexe commented 3 months ago

Hello @Lyokone thank you for reaching out, due to project requirements I can not move to the latest versions.

Lyokone commented 3 months ago

I cannot reproduce this issue on my side. If you cannot move you whole project to new versions, you can try to reproduce this on a sample project. But if you cannot move to the latest version, you will not get the fix anyway.

ahmadexe commented 3 months ago

Perfect, unable to reproduce the issue on latest version in other projects. Thank you for the help!