Skip to main content
Up and Coming
April 28, 2015

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
    This topic has been closed for replies.

    1 reply

    sapandaAuthor
    Up and Coming
    April 29, 2015
    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);