Question by
Ka3anava · Oct 01, 2016 at 07:24 PM ·
androidunity 5streamingassetsxmlserializer
Issues with reading XML file from StreamingAssets on Android!
Hello every one. I've faced with a problem that I can't read data from XML file which is in StreammingAssets folder. On Editor everything works fine but on Android Doesn't.
public void Start () {
Type[] itemTypes = { typeof(Equipment), typeof(Weapon), typeof(Consumeble), typeof(Jevelary) };
XmlSerializer serializer = new XmlSerializer(typeof (ItemContainer), itemTypes);
TextReader textReader = new StreamReader (Application.streamingAssetsPath + "/" + "Items.xml");
itemContainer = (ItemContainer)serializer.Deserialize (textReader);
textReader.Close ();
}
I am sure that the problem is in this line:
TextReader textReader = new StreamReader (Application.streamingAssetsPath + "/" + "Items.xml");
I have no Idea how to resolve it. Thanks in advance.
Comment
Your answer
Follow this Question
Related Questions
NullReferenceException while reading xml file in android device 2 Answers
Loading JSON from StreamingAssets on android(c#) 0 Answers
Unity3d 5 failed to re-package resources (Android build problem) 1 Answer
IAPs problems after porting Google Play Store game to Amazon Appstore 0 Answers
Quest 2 Building Issue System.Windows.Forms.dll assembly && OnMouse_ event handlers 0 Answers