cordova-plugin-camera-with-exif icon indicating copy to clipboard operation
cordova-plugin-camera-with-exif copied to clipboard

Android Gallery Crashes: "E/TaskPersister: File error accessing recents directory (directory doesn't exist?)"

Open MattSynaptic opened this issue 4 years ago • 1 comments

On Android, whenever I open the device gallery select a photo from the Downloads folder, the app crashes with this message in my Android Studio log:

E/TaskPersister: File error accessing recents directory (directory doesn't exist?).

If, however, I go the same photo in the "Gallery" folder of the Gallery, it loads it fine. I'm on a Samsung Galaxy Tab A (2017) with Android 9.

MattSynaptic avatar Jun 26 '20 19:06 MattSynaptic

I figured out a band-aide for it by adding the code below at the end of getRealPath() in FileHelper.java:

        // If the path is still null try the getPath() that is used for files
        if (realPath == null && uri != null) {
            realPath = uri.getPath();
        }

        // If null, return empty string to prevent app crashing
        return realPath != null ? realPath : "";

A proper fix should probably be included in a future release.

MattSynaptic avatar Jun 30 '20 20:06 MattSynaptic