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;
}
Error: [firebase_storage/object-not-found] No object exists at the desired reference.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With