Firebase Storage flutter uploadTask.onComplete crashes ios app

Viewed 836

i have flutter app setup with firestore, fcm and firebase cloud storge which works great on android, and on ios i have added GoogleService-Info.plist to Runner from xcode and also called await Firebase.initializeApp(); on my main.dart on android firestore and storage works good i am able to CRUD data, upload files but when i try to upload media on to firebase on ios with this code

Future uploadFile(int index, int type) async {
    String fileName =
        DateTime.now().millisecondsSinceEpoch.toString() + "${widget.userId}";
    StorageReference reference = FirebaseStorage.instance.ref().child(fileName);
    StorageUploadTask uploadTask = reference.putFile(File(images[index]));
    StorageTaskSnapshot storageTaskSnapshot = await uploadTask.onComplete;
    storageTaskSnapshot.ref.getDownloadURL().then((downloadUrl) {
           setState(() {
        isLoading = false;
        imageUrl = downloadUrl;

      });
    }, onError: (err) {
      setState(() {
        isLoading = false;
      });
    });
  }

the ios app crashes abnormally nothing is being printed on the console when run normally but when run on verbose mode i see this logged

[+123976 ms] Service protocol connection closed.
[   +1 ms] Lost connection to device.
[  +35 ms] DevFS: Deleting filesystem on the device
(file:///Users/Me/Library/Developer/CoreSimulator/Devices/12E19722-CC83-452B-B263-EF624D069BED/dat
a/Containers/Data/Application/BC48EA57-B913-4281-9628-59C783B0FE77/tmp/r2a_mobile28vRsI/r2a_mobile/)
[ +258 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not
completed
[   +4 ms] "flutter run" took 223,298ms.
[ +271 ms] ensureAnalyticsSent: 264ms
[   +2 ms] Running shutdown hooks
[        ] Shutdown hook priority 4
[   +7 ms] Shutdown hooks complete
[   +2 ms] exiting with code 0

have also added <key>CFBundleURLSchemes</key> on to my info.plist with my REVERSED_CLIENT_ID from google plist

Firebase Packages on pubspec:

  firebase_core: ^0.5.0
  cloud_firestore: ^0.14.0+2
  firebase_storage: ^4.0.0
  firebase_messaging: ^7.0.0

Flutter Version:

Flutter 1.20.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision bbfbf1770c (10 days ago) • 2020-08-13 08:33:09 -0700
Engine • revision 9d5b21729f
Tools • Dart 2.9.1

i really need some help here Thanks in Advance

0 Answers
Related