Files written to internal memory even with Write Persmission set to external, Android

I have an app that explores the user performance to a .json file at the end of a session. I’ve tested this in-editor and on device so I know the file is being written, since I’m able to read it from the location. However, I’m unable to see the files in Windows Explorer when browsing to my app’s folder on the android phone. I see the folder, but within files, it’s an empty folder.

I’m using Application.PersistentDataPath as the write/read location. For the build settings, under player settings, I set the Write Permission to “External (SD Card)”, and the install location to “Prefer External”.

I added a debug that shows a message on screen after a save and it tells me that the persistent data path string is still “storage/emulated/0/Android/data/appname/file.json”, which is internal memory. I cannot see any files when viewing the app folder from WIndows Explorer.

I’m unsure if the file is just hidden and windows doesn’t have permission to view it, or what. I to have “Show hidden files” enabled in windows, and on the phone. Oddly enough, I can’t even see the folder with the phone’s built-in file explorer.

Any idea how I can get the file to show up so I can copy it onto my PC? Thanks in advance.

This will never change.

Enabling SD just lets your app to even get at the external storage, aka “permission.”

You still need the path to it… hie thee to google, or start here:

https://discussions.unity.com/t/564415

Ah thank you. I will take a look. This on;y solves half the problem. As I also need this app to write to an external file on iOS. Might be easier to just send the file to Firebase and just download the JSON from there.