OSX Run Time Failure

Discussion and help for Easy Save 3
Post Reply
sonicviz
Posts: 6
Joined: Mon Oct 28, 2013 3:57 pm

OSX Run Time Failure

Post by sonicviz »

Hi,

I have an old app using Easy Save 3 that I'm updating to the latest Unity Builds on Android, Windows, iOS, and OSX.

All (ie: Android, iOS, and Windows builds) are working fine with Easy Save 3 apart from OSX at run time in XCode.
I'm using the PlayerPrefs setting in Easy Save 3.

However, OSX is a real pita, and to get it to upload to the Appstore you need to sandbox it with "com.apple.security.app-sandbox" entitlements in XCode. I add mic permissions as it's an audio app.
If I don't do this, and build/run it XCode there's no problem, it runs fine. But it will get rejected when it tries to upload in the final archive step because it's not sandboxed (way to go Apple, can't you do that at build time?).

If I add then add the sandbox entitlements it will buld but when running it will get a file write error on Easy Save 3 (it looks like) which appears to be a security permission issue, which I'm guessing is related to the new sandbox settings. But there's no custom file choices for that in the sandbox settings for file permissions.

Using Unity 2023.1.10f1

Any clues on how to resolve this?

Thanks,
Paul

Errors look like:
UnauthorizedAccessException: Access to the path is denied.
at System.IO.Directory.InsecureGetCurrentDirectory () [0x00000] in <00000000000000000000000000000000>:0
at System.IO.Path.InsecureGetFullPath (System.String path) [0x00000] in <00000000000000000000000000000000>:0
at System.IO.Path.GetFullPath (System.String path) [0x00000] in <00000000000000000000000000000000>:0
at System.IO.FileInfo..ctor (System.String originalPath, System.String fullPath, System.String fileName, System.Boolean isNormalized) [0x00000] in <00000000000000000000000000000000>:0
at ES3Internal.ES3Stream.CreateStream (ES3Settings settings, ES3Internal.ES3FileMode fileMode) [0x00000] in <00000000000000000000000000000000>:0
at ES3Reader.Create (ES3Settings settings) [0x00000] in <00000000000000000000000000000000>:0
at ES3.Load[T] (System.String key, T defaultValue, ES3Settings settings) [0x00000] in <00000000000000000000000000000000>:0
at SettingsManager.Init () [0x00000] in <00000000000000000000000000000000>:0
at SettingsManager.set_GameState (System.Int32 value) [0x00000] in <00000000000000000000000000000000>:0

UnauthorizedAccessException: Access to the path is denied.
at System.IO.Directory.InsecureGetCurrentDirectory () [0x00000] in <00000000000000000000000000000000>:0
at System.IO.Path.InsecureGetFullPath (System.String path) [0x00000] in <00000000000000000000000000000000>:0
at System.IO.Path.GetFullPath (System.String path) [0x00000] in <00000000000000000000000000000000>:0
at System.IO.FileInfo..ctor (System.String originalPath, System.String fullPath, System.String fileName, System.Boolean isNormalized) [0x00000] in <00000000000000000000000000000000>:0
at ES3Internal.ES3Stream.CreateStream (ES3Settings settings, ES3Internal.ES3FileMode fileMode) [0x00000] in <00000000000000000000000000000000>:0
at ES3Writer.Create (ES3Settings settings) [0x00000] in <00000000000000000000000000000000>:0
at ES3.Save[T] (System.String key, T value, ES3Settings settings) [0x00000] in <00000000000000000000000000000000>:0
at HarpninjaNews.Awake () [0x00000] in <00000000000000000000000000000000>:0
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: OSX Run Time Failure

Post by Joel »

Hi Paul,

Although I've not been able to replicate this at my end, and seems to do with the way that CSharp checks whether a path is valid when the location is set to PlayerPrefs. If you private message me your invoice number I can send over an update which circumvents that piece of code to work around that, as it's not necessary to run that check when the location is PlayerPrefs.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
sonicviz
Posts: 6
Joined: Mon Oct 28, 2013 3:57 pm

Re: OSX Run Time Failure

Post by sonicviz »

Thanks.

How can I find the receipt #?
Search on Asset Store shows
MOODKIE
Easy Save - The Complete Save Data & Serializer System
207.0 KB
Purchase date: Jan 27, 2012
Organization: sonicviz(Personal)

but you can't search easily through the invoices it seems, and there's a lot of pages.
I thought it was on my profile but is blank, which is strange, as you needed it to register.
Been a long time since I posted, you can check it was back 2013 last time I think.

I'm kind of on the clock here as I hired a cloud mac for a week to test if I could upgrade that way rather than have to buy a mac mini.
Working, slowly though!

Thanks,
Paul
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: OSX Run Time Failure

Post by Joel »

Hi Paul,

Just replied to your PM.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
sonicviz
Posts: 6
Joined: Mon Oct 28, 2013 3:57 pm

Re: OSX Run Time Failure

Post by sonicviz »

Aok, ty!
trinadin
Posts: 1
Joined: Mon Feb 12, 2024 4:24 am

Re: OSX Run Time Failure

Post by trinadin »

I seem to be getting a similar error when trying to build for OSX. I believe it also has to do with the sandboxing, but I'm not sure. When I build it as an app, it works fine, but if I build it as an Xcode project and Run it from there, I get the permission issue. I'm saving as PlayerPrefs.

Could you send me that same fix if applicable?

UnauthorizedAccessException: Access to the path is denied.
at System.IO.Directory.InsecureGetCurrentDirectory () [0x00010] in <dcf6bec1c5764d29a37432d4b047f650>:0
at System.IO.Path.InsecureGetFullPath (System.String path) [0x00117] in <dcf6bec1c5764d29a37432d4b047f650>:0
at System.IO.Path.GetFullPath (System.String path) [0x00000] in <dcf6bec1c5764d29a37432d4b047f650>:0
at System.IO.FileInfo..ctor (System.String originalPath, System.String fullPath, System.String fileName, System.Boolean isNormalized) [0x00024] in <dcf6bec1c5764d29a37432d4b047f650>:0
at System.IO.FileInfo..ctor (System.String fileName) [0x00000] in <dcf6bec1c5764d29a37432d4b047f650>:0
at (wrapper remoting-invoke-with-check) System.IO.FileInfo..ctor(string)
at ES3Internal.ES3Stream.CreateStream (ES3Settings settings, ES3Internal.ES3FileMode fileMode) [0x0000d] in <ac40c0c70b5b47e5ae790246bfb157b4>:0
at ES3Reader.Create (ES3Settings settings) [0x00000] in <ac40c0c70b5b47e5ae790246bfb157b4>:0
at ES3.Load[T] (System.String key, T defaultValue, ES3Settings settings) [0x00017] in <ac40c0c70b5b47e5ae790246bfb157b4>:0
at ES3.Load[T] (System.String key, T defaultValue) [0x00009] in <ac40c0c70b5b47e5ae790246bfb157b4>:0
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: OSX Run Time Failure

Post by Joel »

trinadin wrote: Mon Feb 12, 2024 4:26 am I seem to be getting a similar error when trying to build for OSX. I believe it also has to do with the sandboxing, but I'm not sure. When I build it as an app, it works fine, but if I build it as an Xcode project and Run it from there, I get the permission issue. I'm saving as PlayerPrefs.

Could you send me that same fix if applicable?

UnauthorizedAccessException: Access to the path is denied.
at System.IO.Directory.InsecureGetCurrentDirectory () [0x00010] in <dcf6bec1c5764d29a37432d4b047f650>:0
at System.IO.Path.InsecureGetFullPath (System.String path) [0x00117] in <dcf6bec1c5764d29a37432d4b047f650>:0
at System.IO.Path.GetFullPath (System.String path) [0x00000] in <dcf6bec1c5764d29a37432d4b047f650>:0
at System.IO.FileInfo..ctor (System.String originalPath, System.String fullPath, System.String fileName, System.Boolean isNormalized) [0x00024] in <dcf6bec1c5764d29a37432d4b047f650>:0
at System.IO.FileInfo..ctor (System.String fileName) [0x00000] in <dcf6bec1c5764d29a37432d4b047f650>:0
at (wrapper remoting-invoke-with-check) System.IO.FileInfo..ctor(string)
at ES3Internal.ES3Stream.CreateStream (ES3Settings settings, ES3Internal.ES3FileMode fileMode) [0x0000d] in <ac40c0c70b5b47e5ae790246bfb157b4>:0
at ES3Reader.Create (ES3Settings settings) [0x00000] in <ac40c0c70b5b47e5ae790246bfb157b4>:0
at ES3.Load[T] (System.String key, T defaultValue, ES3Settings settings) [0x00017] in <ac40c0c70b5b47e5ae790246bfb157b4>:0
at ES3.Load[T] (System.String key, T defaultValue) [0x00009] in <ac40c0c70b5b47e5ae790246bfb157b4>:0
Hi there,

If you send me your order or invoice number on moodkie.com/contact I can send the update.

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