Recently using some exception handling / crash tracking software I noticed a percentage of users on android devices were throwing a UnauthorizedAccessException when trying to save!
Doing some research I saw a few developers complaining about issues regarding changing paths being returned depending on internal vs external storage so I began logging out what the Application.persistentDataPath was returning on those users throwing the exception.
To my surprise it seems that when I logged out Application.persistentDataPath it was not different paths than expected but actually returning NULL. My save code uses is pretty simple and I create the file path like so:
string filePath = System.IO.Path.Combine( Application.persistentDataPath, "DI.txt" );
Any idea on how / why / when the Application.persistentDataPath should or would return NULL?
This does not happen to our ios users!!!