Load from Xml on Iphone and Android

Hi,

i am trying to load data from xml file stored in Assets/Resources/ on iPhone, but with no luck so far. I was looking into several other similar topics, but none of them realy helped in any way. So let me ask again for some direct guide how to make work xml on Iphone and Android for someone who has very little experience with xml.

On Mac it works without any issues.

Code to get the xml:

string filepath = Application.dataPath + "/Resources/gamedata.xml";
XmlDocument myXml = new XmlDocument();
xmlDoc.Load(filePath);

Error :

Directory not found exception : Cound not find a part of the path “/var/mobile/Applications/86D…/Game.app/Data/Resources/gamedata.xml”.

Thanks for any help

Make sure your Player Settings have .NET 2.0, not .NET 2.0 Subset

put the XML file in a folder called “Resources”. then use Resources.Load(path), where the root of path is the resources folder.