ImagePicker.launchCameraAsync problem in SDK 28

After moving from SDK 27 I’m having an issue with launchCameraAsync as it returns a “content://” uri rather than a “file://” uri as before.

I’m trying to create an asset out of this but I’m not able to find any information on how to do this, old way doesn’t work as apparently it can’t be called on “content://” uris.

Any help is appreciated :).

Oops! We changed the behavior not to save the taken image to device gallery and it caused it, need a fix! Sorry for that. To go round this you can use FileSystem.copyAsync and make a copy of this file and the asset from the copy

1 Like

I threw together a library called expo-asset-utils that can handle this use case. It uses FileSystem.copyAsync under the hood when it finds the suffix. https://github.com/expo/expo-asset-utils

const asset = await AssetUtils.resolveAsync(theUri); // Returns a Expo.Asset
or
const localUri = await AssetUtils.uriAsync(theUri); // Returns a uri with file://
1 Like

I Update My App to SDK 28, All my Assets Stop Working.

Fonts and Images. What i need to Do??

My App Is Detached.
https://play.google.com/store/apps/details?id=br.com.i9xp.ecocard

@victorwads I think your issue might not be related to this thread, can you post a separate one and describe the issue in detail

1 Like

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