Back to Writing
NOTESunityandroidfile-storagepermissions

Unity Android External Storage Path Resolution

May 4, 2021Updated Feb 17, 2026

string FilePos = Application.persistentDataPath + "/SaveFolder";

The traditional approach of setting the path like this used to work fine.

However, it recently stopped working.

var jc = new AndroidJavaClass("android.os.Environment");
var path = jc.CallStatic("getExternalStoragePublicDirectory",
jc.GetStatic("DIRECTORY_DCIM"))
.Call("getAbsolutePath");

string FilePos = path + "/SaveFolder";

So the fix is to resolve the path through AndroidJavaClass as shown above.

if (!Permission.HasUserAuthorizedPermission(Permission.ExternalStorageWrite))
{
// Request storage write permission
Permission.RequestUserPermission(Permission.ExternalStorageWrite);
}

And of course, you need to check and request the appropriate permissions.

![](

FfZQlFlOj_lCb6xMe8g.0THgE44fcDJdAuqWOOc1kMf-DTC2Pm2m7UjHXCVSoTMg.PNG.cdw0424/image.png?type=w966)

Finally, set the Write Permission to External (SDCard) in Player Settings, and you're good to go.