flutterfire
flutterfire copied to clipboard
š [firebase_storage/channel_error] Unable to establish connection on channel.
Bug report
Trying to access an image from Firebase Storage gives an error everytime I try to access, with any path.
In the rules:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read: if true;
allow write: if false;
}
}
}
Using Flutter's future builder when calling this function gives the error in the title which i can't find anything about online except for a closed issue here.
Sample project
FirebaseStorage storage = FirebaseStorage.instance;
Future<Widget> displayImage(String documentId) async {
print(storage.app.name);
Reference imageLink =
storage.ref("ao.jpg"); // this image exists! doesn't work with any path
print(imageLink);
final imageUrl = await imageLink.getDownloadURL(); // errors here i think becasue imageUrl doesn't get printed
print(imageUrl);
return Image.network(
imageUrl.toString(),
errorBuilder: (context, error, stackTrace) => const SizedBox(
width: 0,
height: 0,
),
);
}
Function gets called here
widgets.add(FutureBuilder<Widget>(
future: displayImage(documentId),
builder: (context, snapshot) {
if (snapshot.hasData) {
return (snapshot.data!);
} else if (snapshot.hasError) {
return Text('${snapshot.error}'); // this line prints the error
}
// By default, show a loading spinner.
return const CircularProgressIndicator();
},
));
@sickleox2 What platform are you seeing this behavior on ? I tried with firebase_storage plugin example on Android and it seems to be working fine upon uploading a file. Can you try the same and check if using it, you still get the same error or not ?
Iām using the iOS simulator.
I tried with firebase_storage plugin example on Android and it seems to be working fine upon uploading a file. Can you try the same and check if using it, you still get the same error or not ?
Did you get a chance to check this ?
Hey @sickleox2. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@sickleox2 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.