FileSystem.makeDirectoryAsync() failures

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?

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: java - How do you write to a folder on an SD card in Android? - Stack Overflow

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

@esamelson Do you know the answer to this offhand?

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

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