MediaLibrary asset Id changed after addAssetsToAlbumAsync

After taking a video, I want to add it to an album and keep its asset id for later use

let asset = await MediaLibrary.createAssetAsync(videoUri);
console.log(; // 7492, for example

let assets = ;

// given an album
await MediaLibrary.addAssetsToAlbumAsync(assets, album, false);

// now try to retrieve it
let assetInfo = await MediaLibrary.getAssetInfoAsync(;
// null, not found

But, when I fetch the list of assets in the album using MediaLibrary.getAssetsAsync, I find the video is in the album with an asset id of 7493 (for example). The id has been incremented by 1.

Is this expected behavior? Is there a definitive way to get the actual asset id for an item that has just been added to an album?

Hey @dbruns,

Can you throw this in a Snack so I can try and debug it on my end? Also, is this happening on both platforms?



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