Skip to content

Cannot access SDcard (ExternalStorageDirectoryPath points to /storage/emulated/0) #610

@Epick362

Description

@Epick362

Hello,
I am trying to access and modify files on an external SDcard on Android Marshmallow 6.0.1 (SDK 22)
In AndroidManifest.xml I have declared following permissions:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

When I print RNFS.ExternalStorageDirectoryPath I can only get an emulated path (/storage/emulated/0) which is not on the SDcard.

I think this is most likely some permissions issue but I have checked everything: app permissions in settings which have storage enabled and also when I check the storage permissions dynamically using this code

    const granted = await PermissionsAndroid.request(
        PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE, {
            title: "Grant SD card access",
            message: "We need access"
        }
    );
    if (granted === PermissionsAndroid.RESULTS.GRANTED) {
        console.warn("Permission OK");
    }

It works as expected so I am really out of ideas. Is there anything I might be missing or is this a bug with the library? Thank you for any help with this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions