Skip to content

Storage: Unable to create StorageReference from URL #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tuyenit7 opened this issue Apr 5, 2018 · 2 comments
Closed

Storage: Unable to create StorageReference from URL #26

tuyenit7 opened this issue Apr 5, 2018 · 2 comments

Comments

@tuyenit7
Copy link

tuyenit7 commented Apr 5, 2018

I had that issue when moving firebase implementation (Analytics, RealtimeDB, RemoteConfig, Storage) from native android sdk to cpp sdk. Everything seem to be OK but when i tried to get reference by calling GetReferenceFromUrl() it return error: -Unable to create StorageReference from URL - URL specifies a different bucket (firebasestorage.googleapis.com) than this instance ([my custom bucket]). My URL is download URL of Firebase storage (https://firebasestorage.googleapis.com/v0/b/[my custom bucket]/o/ [my file]). Note: it work fine when i using native android SDK. Please help!

@stewartmiles
Copy link
Contributor

The Android implementation actually has a bug that allows you to create a storage reference using a different bucket to the bucket used to create the storage object. In the C++ implementation to be consistent across all platform (Android, iOS & desktop) we make sure that you can't do this on Android even though it's feasibly possible and incorrect. To fix this issue you should instead create a firebase::storage::Storage instance for the bucket then get a references for that bucket from the new instance instead.

@tuyenit7
Copy link
Author

tuyenit7 commented Apr 9, 2018

Hi, thank you for your explanation. I'd tried follow your suggest successful.
Thanks again!

@tuyenit7 tuyenit7 closed this as completed Apr 9, 2018
@firebase firebase locked and limited conversation to collaborators Oct 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants