Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebase_storage/object-not-found No object exists at the desired reference

my code


Future<String> uploadFile(File _image) async {
  int uploadTimestamp = DateTime.now().millisecondsSinceEpoch;
  Reference ref = FirebaseStorage.instance.ref().child('posts/$uploadTimestamp');
  UploadTask uploadTask = ref.putFile(_image);
  final TaskSnapshot taskSnapshot = await uploadTask.whenComplete(() {});
  final url = await taskSnapshot.ref.getDownloadURL();

  return url;
}

  • firebase_storage: ^10.3.1
  • firebase_core: ^1.19.1

Error: [firebase_storage/object-not-found] No object exists at the desired reference.

like image 447
segun code Avatar asked Oct 16 '25 03:10

segun code


1 Answers

In case someone might still be experiencing this, I experienced the same problem earlier. My fault was I added the Storage feature after I had already initialised firebase onto my project. Reconfiguring firebase after the Storage has been initialised solved it for me, I ran:

 flutterfire configure --project=project_name

Hopefully this helps someone

like image 155
Katlego Avatar answered Oct 17 '25 16:10

Katlego



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!