Quantcast
Channel: Questions in topic: "native plugin"
Viewing all articles
Browse latest Browse all 376

When I am trying to read data from a CSV file using StreamReader(C#) with unity, I am facing Invalid Id 0x00000000. error

$
0
0
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 ![alt text][1] Can you help me resolve this issue? [1]: /storage/temp/192258-screenshot-31.png

Viewing all articles
Browse latest Browse all 376

Trending Articles