MediaLibrary.createAssetAsync never resolves

Please provide the following:

  1. SDK Version: 38.0.2
  2. Platforms(Android/iOS/web/all): Android

Code looks similar to the following:

import * as MediaLibrary from 'expo-media-library';
import * as ImagePicker from 'expo-image-picker';
import * as Permissions from 'expo-permissions';

// ...

    const result = await ImagePicker.launchCameraAsync();

    if (!result.cancelled) {
      console.log("result:", result.uri);
      const cachedAsset = await MediaLibrary.createAssetAsync(result.uri);
      console.log("cachedAsset", cachedAsset); // <------ THIS
    } else {
      console.log("CANCELLED");
    }

// ...

The line marked with THIS is never executed. It seems like the code throws an error, but even if I use the .catch() or if I use a try/catch, I don’t get any error and the Promise is never resolved.

This is only happening on some specific devices:

  • Works in Samsung A7 (Android 8)
  • Doesn’t work on Samsung S10+ (Android 10)
  • Doesn’t work on LG K5 (Android 9)

Hey @pixmat,

If you are able to consistently reproduce this issue, could you please create a Github Issue with said repro and as much relevant information as you can provide?

Cheers,
Adam

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