fix(android): FileNotFoundException after application cache got cleared#1922
Conversation
|
@Gustl22 can you have a look? 🙏 |
|
Thank you for the contribution and sorry for the delay! |
| if (!loadedFiles.containsKey(fileName) || | ||
| // the file can be removed from the cache, this | ||
| // can happen automatically when the storage is almost full | ||
| (!kIsWeb && !fileSystem.file(loadedFiles[fileName]).existsSync())) { |
There was a problem hiding this comment.
I would prefer to check also check for if defaultTargetPlatform == Platform.Android, if it's something that only occurs on android.
I would also prefer to use await exists to not block the thread.
Also do you have some reference (preferably of Android) we can add to the docs here?
|
@krispypen are you planning on finishing up this PR? :) |
Oh I missed the previous message, I'll update today! @spydon |
|
@spydon, do you happen to have any updates on this? |
Gustl22
left a comment
There was a problem hiding this comment.
LGTM haven't tested though. Thank you for the patience!
|
@Gustl22 Thx |
Description
When an android device is low on storage, it can happen that the OS clears the cache of the app. In that case we get a FileNotFoundException when running an audio file for the 2nd time.
Checklist
fix:,feat:,refactor:,docs:,chore:,test:,ci:etc).///, where necessary.Breaking Change
Related Issues