- Home /
When I am trying to read data from a CSV file using StreamReader(C#) with unity, I am facing Invalid Id 0x00000000. error
Hello! I am using Unity 2020.3.2f1. I am using a paid unity asset "Native Android Goodies" to pick up a csv file from the users android phone using the following code as documented by the asset owner.
const string mimeType = "application/CSV";
AGFilePicker.PickFile(file =>
{
var msg = "Picked file: " + file;
Debug.Log(msg);
AGUIMisc.ShowToast(msg);
Debug.Log(file.DisplayName);
Debug.Log(file.OriginalPath);
csvread.ReadCSV(file.OriginalPath);
}, error => AGUIMisc.ShowToast("Picking File" + error),
mimeType
);
This code gives me the desired FilePickerResult and it calls the "ReadCSV" function created by me in another namespace which tries to read the CSV file as received from the picker using the path that the callback returns(file.OriginalPath). The code for the ReadCSV function is as follows:
if (!File.Exists(path))
{
using (StreamReader sr = File.OpenText(path))
{
string s;
while ((s = sr.ReadLine()) != null)
{
Debug.Log(s);
}
}
}
here the path is file.OriginalPath from the callback the issue I am facing is that this ReadCSV code gives me an error "Invalid Id 0x00000000." as shown by the android LogCat Can you help me resolve this issue?
Your answer
Follow this Question
Related Questions
Unable to complete SSL connection 0 Answers
Rendering Android native view with OpenGL 0 Answers
Need to Include a file in the build and use it in the runtime 0 Answers
Draw a line from object to indicate power 0 Answers
UnityEngine.Android not does not exist 0 Answers