il2cpp::os::File::Close() cause crash in iOS after upgrade to 5.3.5

Hi,

after we upgrade Unity version from5.3.4f1 to 5.3.5f1,

we get an error when start game in iPhone/ipad device, but everything is OK in the Editor.

It will be very appreciated if somebody could help us!

we have an error:
il2cpp::os::File::Close()

we find the problem is caused by XML deserilizing.

run the Test() function for serval times, the problem would be reshow randomly.

public void Test(){
        string test = @"<testxml test='1000'/>";
        t.text = "";
        var stream = new MemoryStream (Encoding.UTF8.GetBytes (test));
        var rst = (TestXML)(s.Deserialize (stream));
        t.text = t.text + " " + rst.test.ToString ();
        stream.Close ();
}

 [XmlType("testxml")]
public class TestXML{

        [XmlAttribute]
        public int test;
}

@cg_han-squirrel

Can you submit a bug report for this issue? That way we can track it and feed back to you when it is corrected. Thanks!

sure, and after we set API compatibiliy Level to .NET2.0 subset the problem seems solved.

I’m glad to hear that corrected the issue. I’m not sure why though. Let me know if it occurs again, and we can have a look.

Had the same trouble on 5.3.5f1 with deserializing xml on ios devices. Seems like it tries to close tmp file after xml deserialization and gets EXC_BAD_ACCESS error sometimes. Tip with setting API compatibiliy Level to .NET2.0 subset seems to solve problem.

This issue has been reported as a bug and will be handled by Unity team.
The status of this issue can be tracked here: