Missing MEDIA_LIBRARY permissions appears suddenly after months of usage


Recently an Android app of mine, developed using Expo SDK 53, has been giving the error Missing MEDIA_LIBRARY permissions when adding photos to the gallery.

Briefly, the app allows the user to take some photos using expo-camera. This photos are not only saved inside the app for further usage, but are also saved in the user photo gallery for external usage.

Why has this error only arisen now? The last update of the app has been released at the beginning of March, the app is fairly used, and I've proof that many users have been using this specific photo features using the latest Android update in this past months.

The process of saving such apps inside the gallery is based on this generic code:

// note that at this point the user has already given the permissions by calling the function usePermissions() from expo-media-library // File as defined by expo-file-system/next (for sdk53) let photo = new File(imageUri) const asset = await MediaLibrary.createAssetAsync(photo.uri) // albumName is a string created on some other variables const album = await MediaLibrary.getAlbumAsync(albumName)

Yet, when the getAlbumAsync is called, the MEDIA_LIBRARY error is given.

In my app.json I'm actually blocking this permissions:

"blockedPermissions": [ "android.permission.MANAGE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_MEDIA_IMAGES", "android.permission.READ_MEDIA_VIDEO" ],

this has been done in order to allow the app to be accepted by the Google Play Store policy review process.

How has such a problem arisen only recently, without any code modification or updates of sort. Could this be a problem somehow linked to a silent Google Play Policy update?

0
May 29 at 8:45 AM
User AvatarStefano Gilotto
#android#permissions#expo

No answer found for this question yet.