FileSystem.makeDirectoryAsync() failures

#1

Some of my beta testers are experiencing makeDirectoryAsync() failures on Android. For all other testers it works fine on both Android and iOS.

I’m getting Sentry reports as follows:
‘file:///data/user/0/com.company.app/files/ExperienceData/%2540company%252Fapp/newfolder/’ could not be created.

The people it fails for are mostly on Android API 23, with one on API 19.

Could it be that they are running from external SD card and the FileSystem API doesn’t support that?

#2

hi @mlight – we create a new File when makeDirectoryAsync() is called (https://github.com/expo/expo/blob/master/android/expoview/src/main/java/versioned/host/exp/exponent/modules/api/FileSystemModule.java#L390)

Its possible that WRITE_EXTERNAL_STORAGE permissions might be needed but not sure: https://stackoverflow.com/questions/3551821/android-write-to-sd-card-folder

#3

Thanks @quinlanj

The Expo docs say you should just use “WRITE_EXTERNAL_STORAGE” but several people on this forum and elsewhere say that for Expo you should use “android.permission.WRITE_EXTERNAL_STORAGE” . Do you know which is correct?

Thanks

#4

@esamelson Do you know the answer to this offhand?

#5

Hi @mlight - if you have a plain standalone app, just putting "WRITE_EXTERNAL_STORAGE" in app.json is correct. The posts on here that suggest using "android.permission.WRITE_EXTERNAL_STORAGE" in app.json are out of date. However, if your app is detached, then you will need to include the full scoped name in AndroidManifest.xml.

1 Like
closed #6

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