Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
sapanda's avatar
sapanda
Explorer
10 years ago

Unable to read XML with Mobile SDK 0.5.0 + Unity 5

I just migrated to mobile 0.5.0 and Unity 5 in one go and I'm facing the following issue only in release mode (i.e. not when the "Development Build" flag is checked) any time I try to read an xml file from the Note 4 storage:

UnauthorizedAccessException: Access to the path "/sdcard/Oculus/Product/Settings.xml" is denied.


Everything ran fine in previous versions, and still runs fine in the "Development Build". Anyone know why this might be happening?

Thanks,
Saswat

1 Reply

Replies have been turned off for this discussion
  • Issue resolved.

    I was reading the filestream like this:

    FileStream stream = new FileStream(filename, FileMode.Open);

    Unfortunately using this filestream constructor always opens with ReadWrite permissions. And I guess the release build for Unity 5 is stricter about those permissions? Anyhow, this does the trick:

    FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read);