Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
739 stars 426 forks source link

Dart Unhandled Exception: [firebase_storage/unknown] location should not be a full URL. #326

Closed asongkai closed 3 years ago

asongkai commented 3 years ago

💬 Questions and Help

Hello!

I tried to use the plugin to cache my audio that saved in firebase storage with the url of

https://firebasestorage.googleapis.com/v0/b/ocwa-app.appspot.com/o/142-1624205564448.aac?alt=media&token=b06a7cf9-5050-43ad-b5e9-60c4eda85b54

When I pass the url to the method

file = await FirebaseCacheManager().getSingleFile(widget.url);

and it throws an error in console

E/flutter (32343): [ERROR:flutter/shell/common/shell.cc(103)] Dart Unhandled Exception: [firebase_storage/unknown] location should not be a full URL., stack trace: #0      MethodChannelReference.getDownloadURL (package:firebase_storage_platform_interface/src/method_channel/method_channel_reference.dart:59:7)
E/flutter (32343): <asynchronous suspension>
E/flutter (32343): #1      FirebaseHttpFileService.get (package:flutter_cache_manager_firebase/src/firebase_http_file_service.dart:12:16)
E/flutter (32343): <asynchronous suspension>
E/flutter (32343): #2      WebHelper._updateFile (package:flutter_cache_manager/src/web/web_helper.dart:99:22)
E/flutter (32343): <asynchronous suspension>
E/flutter (32343): #3      WebHelper._downloadOrAddToQueue (package:flutter_cache_manager/src/web/web_helper.dart:67:7)
E/flutter (32343): <asynchronous suspension>
renefloor commented 3 years ago

FirebaseCacheManager is made so you can download files using a gs:// url instead of an https:// url. I don't use the firebase storage myself, but doesn't the https url change all the time? If you use the https url you can just use the standard cache manager instead of the firebasecachemanager.

asongkai commented 3 years ago

Thank you