I get thousands of UnauthorizedAccessExceptions in my Game Performance dashboard followed up by bug reports from angry gamers who can’t save.
Those 3 exceptions make up the bulk:
UnauthorizedAccessException: Access to the path “/storage/sdcard1/Android/data/com…files/savedGames.gd” is denied.
UnauthorizedAccessException: Access to the path “/mnt/internal_sd/Android/data/com…/files/savedGames.gd” is denied.
UnauthorizedAccessException: Access to the path “/mnt/sdcard/Android/data/com…/files/savedGames.gd” is denied.
My settings are:
Install location: Automatic
Write Permission: Internal
…and I’m using Application.persistentdatapath.
I guess this could easily be fixed by giving the game permissions to write on a sd card but that’s something I would like to avoid because of how scary those permissions look to some users.
Any idea how I can work myself around this? Is this a Unity bug? Or am I missing something? Can I force Application.persistentdatapath to give me a “internal” path?