I have an app that is fully tested and works as expected when running the app using expo start
and opening Expo Go on an android device.
Since I have run expo build:android -t apk
, downloaded the .apk and installed it on the same android device. The MediaLibrary no longer functions.
The concerned code is below:
const {status} = await MediaLibrary.requestPermissionsAsync()
if (status === 'granted') {
const asset = await MediaLibrary.createAssetAsync(capturedImage.uri);
// console.log("Loggin image asset after being saved to storage", asset)
MediaLibrary.createAlbumAsync('ALBUM_NAME_HERE', asset)
.then(() => {
// console.log('Album created!');
})
.catch(error => {
console.log('err', error);
});
}
asset
never gets created, nothing showing in DCIM or similar.
ALBUM_NAME_HERE
never gets created, assumingly because no asset
is ever created.
It’s good to note that there is a little bit of capture manipulation in terms of
getSupportedRatiosAsync
& getAvailablePictureSizesAsync
. But I simply select the lowest ratio and then the lowest picture size, based on the lowest ratio.