elbajo elbajo - 17 days ago 5
Java Question

Uiautomatorviewer Premature end of file

I have been using uiautomatorViewer for quite a while and today for the first time i got an error :


org.xml.sax.SAXParseException; systemId:
file:/tmp/uiautomatorviewer_2911009098837440934/dump_6467398984523677157.uix;
lineNumber: 1; columnNumber: 1; Premature end of file.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:391)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1404)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1034)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:392)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:328)
at com.android.uiautomator.tree.UiHierarchyXmlLoader.parseXml(UiHierarchyXmlLoader.java:128)
at com.android.uiautomator.UiAutomatorModel.(UiAutomatorModel.java:42)
at com.android.uiautomator.UiAutomatorHelper.takeSnapshot(UiAutomatorHelper.java:142)
at com.android.uiautomator.actions.ScreenshotAction$1.run(ScreenshotAction.java:85)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
null rootnode after parsing.


I always get this error when i go to this page and i have no idea why, any ideas?

Answer

Just FYI: I filed a bug against the android team. They recently merged a fix for android L: it's working fine now.