Yesterday, it completely stopped working and I can’t seem to figure out why. The only things that are different in terms of the project are some player prefs and I upgraded to the new version of Unity. I believe the issue is that Application.persistentDataPath is returning null.
I noticed that when I changed my writing to “external” in the player prefs, it started working again on Android but it had been working this whole time on “internal” so I don’t understand why this needs to be changed now.
As for iOS, it just completely stopped working and I haven’t been able to get it to work again.
We did encounter Application.persistentDataPath == “” (not null) on Android, but I think it was a different problem.
We set Install Location = Automatic, and Write Access = External(SD Card)
Along with debug/print statements to print out what Application.persistentDataPath is pointing to. That might help.
To use log viewer, install the asset, then in unity at the top you’ll see Reporter. Click on it, and select create. It will add reporter to your scene. You’ll want to do this in your starting scene usually.
To bring up reporter, draw a circle on your tablet screen to bring it up(just do a few quick circles to see it).
Note that log viewer will also show you errors and such. It mimics the console in the editor.
Did you solve this problem. Tonight I was playing around writing to persistsant storage and was working then just stopped. Like it was ignoring it. Worked find when running on pc but not on Android device.
One thing I encountered before was that with different permissions on android, persistantdatapath wasn’t always the same. This was on an older project where the first time the app ran, it stored it in one location and then the second time it stored it in another location after it got the write permission granted. It was a little bit of a pain.
You should use the log viewer and print out what application.persistantdatapath returns during your first scene before you try to write to it. Possibly even at the start of your app. and then later on in the app and then also restart the app and see if the location is the same.
It is also possible that it will return null or “” if it doesn’t have the correct write permissions. (this I’m not sure of though)