react-native-image-picker
react-native-image-picker copied to clipboard
[🐛] Duplicate Cached Files On Android - Gallery Selection
Description
When selecting a single image/video from the gallery on Android, two are created in the cache folder of the app storage.
This may to be due to two calls to getAppSpecificStorageUri
within the Utils.java file. The second of these is called from getOriginalFilePath
which was added on V7.0.0 here https://github.com/react-native-image-picker/react-native-image-picker/commit/7086e95f555bf61143837f3fa8cb4d8a83491b97 , this is also the file that is the duplicate.
This is preventing us cleaning up left over cache files.
As shown in the below image, two file paths are created, the final log is from the React Native side, only one is fed back, but the other still exists in cache.
How to repeat issue and example
- Select a single image from the gallery
- View cache directory of app using Android Studio
Solution
Prevent multiple files being cached when only a single item was selected.
Additional Information
- Image Picker version: 7.0.2
- React Native version: 0.72.6
- Platform: Android
- Development Operating System: MacOS
- Dev tools: Android Studio Hedgehog | 2023.1.1
@Johan-dutoit Any updates on this?
I got the same issue...
same issue, any plans on this getting fixed?
@mattlewer Still same issue