IOException: Cannot create file because a file with the same name already exists

Discussion and help for Easy Save 3
Post Reply
derkoi
Posts: 8
Joined: Fri Nov 22, 2013 12:39 pm

IOException: Cannot create file because a file with the same name already exists

Post by derkoi »

I'm having an odd issue, I'm working on an update to my already released mobile game & all is well aside from this odd bug when I try to save the game.
[Exception] IOException: Cannot create /data/app/~~S4z01UT0zClp599fwVqtQg==/com.---.--------------6nSYXB940alzExsSKHtWmg==/base.apk because a file with the same name already exists.
System.IO.Directory.CreateDirectory (System.String path) (at <00000000000000000000000000000000>:0)
ES3Internal.ES3FileStream.GetPath (System.String path, ES3Internal.ES3FileMode fileMode) (at <00000000000000000000000000000000>:0)
ES3Internal.ES3FileStream..ctor (System.String path, ES3Internal.ES3FileMode fileMode, System.Int32 bufferSize, System.Boolean useAsync) (at <00000000000000000000000000000000>:0)
ES3Internal.ES3Stream.CreateStream (ES3Settings settings, ES3Internal.ES3FileMode fileMode) (at <00000000000000000000000000000000>:0)
ES3Writer.Create (ES3Settings settings, System.Boolean writeHeaderAndFooter, System.Boolean overwriteKeys, System.Boolean append) (at <00000000000000000000000000000000>:0)
ES3.Save[T] (System.String key, T value, ES3Settings settings) (at <00000000000000000000000000000000>:0)
DDIGameDataManager.SaveData () (at <00000000000000000000000000000000>:0)
I am using an old version, v3.3.2f6 as I didn't want to break anything by updating as I also use the online save feature on my website.

I suppose I should update and see if the problem persists but wasn't sure if it's a known issue?

Thanks
Last edited by derkoi on Wed May 04, 2022 6:06 pm, edited 1 time in total.
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: IOException: Cannot create file because a file with the same name already exists

Post by Joel »

Hi there,

I've not seen this issue before. However, judging by the path, it looks like you might be trying to use Application.dataPath rather than Application.persistentDataPath (the latter of which Easy Save uses by default). Application.dataPath points to the APK on Android and is not a writable path.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
derkoi
Posts: 8
Joined: Fri Nov 22, 2013 12:39 pm

Re: IOException: Cannot create file because a file with the same name already exists

Post by derkoi »

Hi, thanks for your quick reply.

It seems that was the issue. No idea why I changed it, but it's been a while since I updated the game so I've likely forgotten :roll: :lol:
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: IOException: Cannot create file because a file with the same name already exists

Post by Joel »

Glad that resolved the issue, let me know if you run into anything else :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply