- Home /
The question is answered, right answer was accepted
How can I read an XML file in Android ? I can't access it
I have my XML file in the following path:
Assets/Resources/Texts/texts.xml
Then I generate the path to my file as follows:
string path = "jar:file://" + Application.dataPath + "!/assets/";
string full_path = Path.Combine(path , "Resources/Texts/texts.xml");
I have tried to deserialize the XML in the following way:
XmlSerializer serializer = new XmlSerializer(typeof(TextContainer));
using (FileStream stream = new FileStream(path, FileMode.Open))
{
return serializer.Deserialize(stream) as TextContainer;
}
But I always get the following error:
IsolatedStorageException: Could not find a part of the path "/jar:file:/data/app/com.myStudio.MyGameName-7McVo4OYODlMnWhwUoK2mw==/base.apk!/assets/Resources/Texts/texts.xml".
Can anyone help me ?
Answer by Vzk91 · Nov 01, 2018 at 11:13 PM
I found the solution here: https://answers.unity.com/questions/210909/android-streamingassets-file-access.html
Follow this Question
Related Questions
How does updating a game work? 0 Answers
C# Getting only the Name of the XML File and not the Directory of the XML File 2 Answers
XmlWriter.Create exception, "Could not find the file..." on Android 0 Answers
How to add android 6.0 permission explanation 0 Answers
Could not load file or assembly 'nunit.core.interfaces (Unity 5.3 and 5.4 only) 0 Answers