Expo getcontentUri dont work

i run again: expo install expo-file-system

but that code dont work

const asset = await MediaLibrary.createAssetAsync(imagemPath) //This ok, i verify, create asset correct

await FileSystem.getContentUriAsync(asset.uri).then(cUri => {

            console.log(cUri);
        }) //this throw error

print that error :

[Mon Aug 23 2021 03:20:03.742] WARN Possible Unhandled Promise Rejection (id: 0):
Error: Failed to find configured root that contains /storage/emulated/0/DCIM/teste3919_1.jpg
promiseMethodWrapper@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:4524:45

my packages :> {

“main”: “index.js”,

“scripts”: {

"android": "react-native run-android",

"ios": "react-native run-ios",

"web": "expo start --web",

"start": "react-native start",

"test": "jest"

},

“dependencies”: {

"@expo-google-fonts/poppins": "^0.2.0",

"@react-native-async-storage/async-storage": "^1.13.0",

"@react-native-community/masked-view": "0.1.10",

"@react-navigation/native": "^5.9.4",

"@react-navigation/stack": "5.14.5",

"@tensorflow-models/mobilenet": "^2.1.0",

"@tensorflow/tfjs": "^3.7.0",

"@tensorflow/tfjs-react-native": "^0.6.0",

"expo": "~41.0.1",

"expo-app-loading": "^1.1.2",

"expo-camera": "~11.0.2",

"expo-file-system": "~11.0.2",

"expo-font": "~9.1.0",

"expo-gl": "~10.2.0",

"expo-gl-cpp": "~10.1.0",

"expo-image-manipulator": "~9.1.0",

"expo-image-picker": "~10.1.4",

"expo-media-library": "~12.0.2",

"expo-print": "~10.1.0",

"expo-sharing": "~9.1.2",

"expo-splash-screen": "~0.10.2",

"expo-updates": "~0.5.4",

"jpeg-js": "^0.4.3",

"react": "16.13.1",

"react-dom": "16.13.1",

"react-native": "~0.63.4",

"react-native-fs": "^2.18.0",

"react-native-gesture-handler": "~1.10.2",

"react-native-reanimated": "~2.1.0",

"react-native-responsive-fontsize": "^0.5.0",

"react-native-safe-area-context": "3.2.0",

"react-native-screens": "~3.0.0",

"react-native-send-intent": "^1.2.3",

"react-native-unimodules": "~0.13.3",

"react-native-web": "~0.13.12",

"styled-components": "^5.3.0"

},

“devDependencies”: {

"@babel/core": "^7.9.0",

"@types/react": "~16.9.35",

"@types/react-native": "~0.63.2",

"@types/styled-components-react-native": "^5.1.1",

"babel-preset-expo": "~8.3.0",

"jest-expo": "~41.0.0",

"typescript": "~4.0.0"

},

“jest”: {

"preset": "react-native"

},

“private”: true

}

i need replacing the xml of expo-file-system Fileprovider Android

i create a new folder xml config
in app/main/res/xml

and create file config:
in app/main/res/xml/file_system_provider_paths.xml

<?xml version="1.0" encoding="utf-8"?>
<paths>
    <files-path name="expo_files" path="." />
    <cache-path name="cached_expo_files" path="." />
    <external-path name="external-path" path="." />
    <external-files-path name="external-files-path" path="." />
    <external-media-path name="external-media-path" path="." />
</paths>

in app/main/AndroidManifest.xml


<manifest **xmlns:tools="http://schemas.android.com/tools"** >

<activity **tools:replace="android:resource"**

**      android:resource="@xml/file_system_provider_paths"** >

not to change bellow

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