Baseflow / flutter_cache_manager

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

[Bug] Getting "HttpException: Invalid statusCode: 403" error #366

Open yasinarik opened 2 years ago

yasinarik commented 2 years ago

🐛 Bug Report - Getting "HttpException: Invalid statusCode: 403" error

Expected behavior

The code is long but here are the important part.

FileInfo? _fileInfo;
DefaultCacheManager _cacheManager = DefaultCacheManager();

_fileInfo = await _cacheManager.downloadFile(videoUrl, force: true); 
// Also tried with --> force: false
// I use *await* but I know it is optional, in my case I need that.

if (_fileInfo == null) {
  videoPlayerController = VideoPlayerController.network(videoUrl); 
  // When the file cannot be cached, the video is played from .network()
} else {
  videoPlayerController = VideoPlayerController.file(_fileInfo.file);
  // When the file is cached, the video is played from .file()
}

I have also tried adding the key for allowing arbitrary loads on iOS --> NSAllowsArbitraryLoads

<key>NSAppTransportSecurity</key>
<dict>
   <key>NSAllowsArbitraryLoads</key>
   <true/>
</dict>

Version:

flutter: 2.10.1 flutter_cache_manager: ^3.3.0

Platform:

banool commented 2 years ago

I'm also seeing an issue like this.

gOzaru commented 1 year ago

Why did I suddenly have this same error too? I wanted to access Firebase storage. It used to working well, but now it is always error. Is this error from Firebase or Flutter_Cache_Manager?

Update: Now I know, Firebase is error [check here]

Firebase Error - Screenshot 2022-09-04 054003

But, how come the package doesn't have any error handling up until now if it is error?

noga-dev commented 1 year ago

Console getting spammed by these. Ought to be a way to opt out of that without changing package code locally.