dtmilano / AndroidViewClient

Android ViewServer and ADB client
Apache License 2.0
1.61k stars 344 forks source link

ERROR: Offending XML: #190

Closed wasaig closed 7 years ago

wasaig commented 8 years ago

getting ERROR: Offending XML: during xml parsing in __parseTreeFromUiAutomatorDump method. The xml is having some junk characters at the end which is causing the parsing to fail.

I have made a temporary fix for myself as follows. try: start_xml_index = receivedXml.index("<") end_xml_index = receivedXml.rindex(">") except ValueError: raise ValueError("received does not contain valid XML data") self.root = parser.Parse(receivedXml[start_xml_index:end_xml_index+1]) self.views = parser.views self.viewsById = {}

Please look into this issue and fix it.

Thanks