Closed Joshmatjjen closed 3 years ago
are permissions for external storage already granted?
Yes... It work Well for Android 7.0
add permissions like this, if permission is true then mkdir like:
const granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE, { title: "message...", message: "message...", buttonNeutral: "message..", buttonNegative: "No", buttonPositive: "Yes" } ); if (granted === PermissionsAndroid.RESULTS.GRANTED) { RNFetchBlob.fs.exists(RNFetchBlob.fs.dirs.SDCardDir + '/myDownloader/') .then((exist) => { if (!exist) { RNFetchBlob.fs.mkdir( RNFetchBlob.fs.dirs.SDCardDir + '/myDownloader/') .then(() => { console.log('file add') }) .catch((err) => { console.log('error',err) }) } }) .catch((error) => console.log('error', error)) }
Same issue
try to add requestLegacyExternalStorage in AndroidManifest
<manifest ... >
<!-- This attribute is "false" by default on apps targeting
Android 10 or higher. -->
<application android:requestLegacyExternalStorage="true" ... >
...
</application>
</manifest>
Do you find any work around for this?
Still facing this issue can't create the directory on my device.
Any time i type the Error below, I get an error : Error: mkdir failed to create some or all directories in '/storage/emulated/0/
RNFetchBlob.fs.mkdir( RNFetchBlob.fs.dirs.SDCardDir + '/myDownloader', );
"rn-fetch-blob": "^0.12.0", "react-native": "0.62.2",
PLEASE HELP