ES3File: Couldn't find the file on Android device.

Discussion and help for Easy Save 3

ES3File: Couldn't find the file on Android device.

Postby jwiden » Mon Nov 04, 2019 4:30 am

I cannot find my file saved in the Asset from an Android device. It works well in the editor.

My code:
var path = Application.streamingAssetsPath + "/FilePos";
filePos = new ES3File(path);
if (!filePos.KeyExists(_KeyDataGame.keySaveFilePos))
{
print("coultn't find the file");
}
jwiden
 
Posts: 3
Joined: Mon Nov 04, 2019 4:23 am

Re: ES3File: Couldn't find the file on Android device.

Postby Joel » Mon Nov 04, 2019 8:09 am

Hi there,

Steaming Assets Path is not writable at runtime on Android (see https://docs.unity3d.com/Manual/StreamingAssets.html).

You should use Application.persistentDataPath instead, which Easy Save uses by default if you only specify a filename or relative path.

All the best,
Joel
Joel Tebbett @ Moodkie Interactive
Twitter - Unity - LinkedIn
User avatar
Joel
Moodkie Staff
 
Posts: 2523
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES3File: Couldn't find the file on Android device.

Postby jwiden » Mon Nov 04, 2019 2:18 pm

Joel wrote:Hi there,

Steaming Assets Path is not writable at runtime on Android (see https://docs.unity3d.com/Manual/StreamingAssets.html).

You should use Application.persistentDataPath instead, which Easy Save uses by default if you only specify a filename or relative path.

All the best,
Joel

I have a file to save the location of a gameObject created from the editor. How to load on Android?
I used the paths is Application.StreamingAssets, Application.persistentDataPath and Application.dataPath.
jwiden
 
Posts: 3
Joined: Mon Nov 04, 2019 4:23 am

Re: ES3File: Couldn't find the file on Android device.

Postby Joel » Mon Nov 04, 2019 2:27 pm

Hi there,

If you want to include a file in the built player, you should use a Resources folder:
https://docs.moodkie.com/easy-save-3/es ... resources/

All the best,
Joel
Joel Tebbett @ Moodkie Interactive
Twitter - Unity - LinkedIn
User avatar
Joel
Moodkie Staff
 
Posts: 2523
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES3File: Couldn't find the file on Android device.

Postby jwiden » Mon Nov 04, 2019 3:42 pm

Joel wrote:Hi there,

If you want to include a file in the built player, you should use a Resources folder:
https://docs.moodkie.com/easy-save-3/es ... resources/

All the best,
Joel

It works, thank you very much. ;) ;) ;)
jwiden
 
Posts: 3
Joined: Mon Nov 04, 2019 4:23 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron