MediaLibrary.getAssetsAsync return error "Could not read file or parse EXIF tags" on some device

Please provide the following:

  1. SDK Version: 41
  2. Platforms(Android/iOS/web/all): Android 10 Xiaomi Poco F1
  3. Add the appropriate “Tag” based on what Expo library you have a question on. MediaLibrary - Expo Documentation

MediaLibrary.getAssetsAsync return error “Could not read file or parse EXIF tags”, only in some device ( Android 10 Xiaomi Poco F1),

I found out that the error caused by sortBy options when MediaLibrary.getAssetsAsync is call,

const mediaPhotos = await MediaLibrary.getAssetsAsync( {
        first: 24,
        sortBy: ["creationTime"],
} )

the code above we return an error “Could not read file or parse EXIF tags”

BUT after i remove sortBy: ["creationTime"] like the code below.

const mediaPhotos = await MediaLibrary.getAssetsAsync( {
        first: 24,
} )

the application works fine, but the image/photo will load in RANDOM order.

How to sort the image/photo according to its creation time ??

complete error message

Could not read file or parse EXIF tags
at node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:103:50 in promiseMethodWrapper
at node_modules/@unimodules/react-native-adapter/build/NativeModulesProxy.native.js:15:23 in moduleName.methodInfo.name
at node_modules/expo-media-library/build/MediaLibrary.js:189:7 in getAssetsAsync
at node_modules/expo-media-library/build/MediaLibrary.js:189:7 in getAssetsAsync
at containers/ImagePickerGalery.js:100:25 in getPhotosAsync
at containers/ImagePickerGalery.js:100:25 in getPhotosAsync
at containers/ImagePickerGalery.js:138:6 in <anonymous>
at [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.