Log in or register to post comments

XmlException: invalid data - Unity - Vuforia problem

May 16, 2016 - 6:23am #1


I have the problem with the Vuforia files even in sample project.

XmlException: invalid data.
System.Xml.XmlStreamReader.Read (System.Char[] dest_buffer, Int32 index, Int32 count)
Mono.Xml2.XmlTextReader.ReadTextReader (Int32 remained)
Mono.Xml2.XmlTextReader.PeekChar ()
Mono.Xml2.XmlTextReader.ReadContent ()
Mono.Xml2.XmlTextReader.Read ()
System.Xml.XmlTextReader.Read ()
Vuforia.EditorClasses.ConfigParser.fileToStruct (System.String configXMLPath, Vuforia.EditorClasses.ConfigData configData)
Vuforia.EditorClasses.ConfigDataManager.ReadConfigData (System.String dataSetFilePath)
Vuforia.EditorClasses.ConfigDataManager.DoRead ()
Vuforia.EditorClasses.SceneManager.InitScene ()
Vuforia.EditorClasses.DatabaseLoadEditor.OnEnable ()
My Unity generate that error without explanation where and why. No string number - nothing. That was really WIRD! 
So I try to get any solution from Vuforia forum - nothing solving my problem. Forget to mention - with that error you Unity project start and looks like working but only looks like! It not working!! Because in Image Target - Image Target Behaviour script - you do not Drop Down menu (Database,Image Target,With,Height) - so you can not choose target.
I start dig the problem deep. Figured that the problem appears only if you load dataset.package from the Target Manager. Look inside any Database Target Package - it have 3 files type (.dat, .jpg, .xml). The problem was only while you loading any .xml files from Vuforia. Also I want to notice that I am on MAC.
So two part of the problem Mac and .XML types file. Did you guess? Problem simply and stupid - ENCODING! While you on MAC - you use as a default UTF-8, but when on Windows you default - ANSI encoding. 
So if you open .xml file on MAC and instead of the default UTF-8 somehow save in ANSI (I have a Windows with Parallels - so I do it in that way.). After the saving .xml files in StreamingAssets/QCAR/ folder in ANSI - all errors dissapear and all hidden menu appears in a Image Target Behaviour script(Image Target) - and in Database Load Behaviour script (ARCamera).
Request to the Vuforia developers - can you Solve that .XML Encoding problem from you side because MAC users can not work with Vuforia+Unity without that kind dance with tambourine?
Log in or register to post comments