Repository navigation
Closed
Description
Hey! First of all thanks for the library! However:
[07-27 11:19:15.606 14119-14141/io.fnx.draw I/flutter: ══╡ EXCEPTION CAUGHT BY SERVICES ╞══════════════════════════════════════════════════════════════════
07-27 11:19:15.611 14119-14141/io.fnx.draw I/flutter: The following UnsupportedError was thrown resolving an image codec:
07-27 11:19:15.611 14119-14141/io.fnx.draw I/flutter: Unsupported operation: Cannot set value in unmodifiable Map
07-27 11:19:15.613 14119-14141/io.fnx.draw I/flutter: When the exception was thrown, this was the stack:
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: #0 _ImmutableMap.[]= (dart:core/runtime/libimmutable_map.dart:72:5)
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: #1 CacheManager._downloadFile (package:flutter_cache_manager/flutter_cache_manager.dart:268:14)
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: <asynchronous suspension>
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: #2 CacheManager.getFile.<anonymous closure> (package:flutter_cache_manager/flutter_cache_manager.dart:236:34)
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: <asynchronous suspension>
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: #3 ReentrantLock._runTask.<anonymous closure>.<anonymous closure> (package:synchronized/src/synchronized_impl.dart:197:29)
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: #8 ReentrantLock._runTask.<anonymous closure> (package:synchronized/src/synchronized_impl.dart:195:14)
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: #10 ReentrantLock._runTask (package:synchronized/src/synchronized_impl.dart:194:16)
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: #11 LockBase._createAndRunTask.run (package:synchronized/src/synchronized_impl.dart:62:14)
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: #12 LockBase._createAndRunTask (package:synchronized/src/synchronized_impl.dart:72:17)
07-27 11:19:15.622 14119-14141/io.fnx.draw I/flutter: #13 ReentrantLock.synchronized (package:synchronized/src/synchronized_impl.dart:230:12)
07-27 11:19:15.623 14119-14141/io.fnx.draw I/flutter: #14 synchronized (package:synchronized/src/synchronized_impl.dart:295:19)
07-27 11:19:15.623 14119-14141/io.fnx.draw I/flutter: #15 synchronized (package:synchronized/src/synchronized_compat.dart:35:10)
07-27 11:19:15.623 14119-14141/io.fnx.draw I/flutter: #16 CacheManager.getFile (package:flutter_cache_manager/flutter_cache_manager.dart:199:11)
07-27 11:19:15.623 14119-14141/io.fnx.draw I/flutter: <asynchronous suspension>
07-27 11:19:15.623 14119-14141/io.fnx.draw I/flutter: #17 CachedNetworkImageProvider._loadAsync (package:cached_network_image/cached_network_image.dart:472:35)
07-27 11:19:15.623 14119-14141/io.fnx.draw I/flutter: <asynchronous suspension>
07-27 11:19:15.623 14119-14141/io.fnx.draw I/flutter: #18 CachedNetworkImageProvider.load (package:cached_network_image/cached_network_image.dart:462:16)
07-27 11:19:15.623 14119-14141/io.fnx.draw I/flutter: #19 ImageProvider.resolve.<anonymous closure>.<anonymous closure> (package:flutter/src/painting/image_provider.dart:266:86)]
When I start my app freshly, everything works. It's working for about 24 hours, and then all images disappear and the message above appears in the log. My guess is that cache information is still present in the SharedPreferences, but files are for some reason gone.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Tomucha commentedon Jul 27, 2018
FYI, my pubspec.lock says:
Tomucha commentedon Jul 31, 2018
@renefloor any chance you will have time to look at this? Let me know please, otherwise I'll need to come up with some alternative ... Thanks!!!
renefloor commentedon Jul 31, 2018
Sorry, I am currently very busy and have no time to look into this project. Will probably work on it in September or October again and will rewrite some important parts of the library.
Edit: btw, it could be that this is already fixed in 0.4.1+1, as I worked on something related to the ImmutableMap for the headers.
Tomucha commentedon Jul 31, 2018
Ok, thanks for info.
Tomucha commentedon Aug 13, 2018
Hi there!
So the problem is here:
https://github.com/renefloor/flutter_cache_manager/blob/2adfc0f73c9f2e145c36cbf24fe1d6fc75296649/lib/flutter_cache_manager.dart#L268
You are modifying header map which was supplied to you as an argument - that's probably not a good idea anyway ... I fixed it in a straightforward way. Here:
https://github.com/renefloor/flutter_cache_manager/blob/2adfc0f73c9f2e145c36cbf24fe1d6fc75296649/lib/flutter_cache_manager.dart#L203
... which I changed to:
It seems to be working now.