Application.persistentDataPath returning null on certain Android devices

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!!!

On my case Application.persistentDataPath was returning a empty string. The problem was on the device. I restart the device and the Application.persistentDataPath start working fine again.

My problem was solved when I noticed the carriage return (/r) character in the ProductName of my project. Look here:
https://forum.unity.com/threads/app…-string-on-some-machines.384000/#post-3604512