尝试从 firebase 存储桶上传图片时 Flutter 应用程序崩溃

时间:2021-02-09 14:37:24

标签: ios flutter firebase-storage

基本上,我使用 Xcode 和 iOS 使应用程序处于颤动状态,在配置文件部分我尝试上传图片,然后应用程序崩溃并关闭,几个月以来我一直在尝试修复它,如果有人可以帮忙

void _deletePicture(index) async {
if (widget.currentUser.imageUrl[index] != null) {
  try {
    StorageReference _ref = await FirebaseStorage.instance
        .getReferenceFromUrl(widget.currentUser.imageUrl[index]);
    print(_ref.path);
    await _ref.delete();
  } catch (e) {
    print(e);
  }
}
setState(() {
  widget.currentUser.imageUrl.removeAt(index);
});
var temp = [];
temp.add(widget.currentUser.imageUrl);
await Firestore.instance
    .collection("Users")
    .document("${widget.currentUser.id}")
    .setData({"Pictures": temp[0]}, merge: true);

} }

Xcode 抛出的错误

<块引用>

线程 1:异常:“URL 必须采用 http[s]://firebasestorage.googleapis.com/v0/b//o/[?token=signed_url_params] 的形式”

<块引用>

libc++abi.dylib:以 NSException 类型的未捕获异常终止

0 个答案:

没有答案
相关问题