uiautomatorviewer 识别android微信元素报错

时间:2022-10-08 21:43:28

org.xml.sax.SAXParseException; systemId: file:/C:/Users/xxxxxxxxx/AppData/Local/T
emp/uiautomatorviewer_1000364766579250143/dump_3481235599237504664.uix; lineNumb
er: 1; columnNumber: 1; 文件提前结束。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalErro
r(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:441)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(X
MLScanner.java:1436)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Driver.next(XMLDocumentScannerImpl.java:1019)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
MLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:649)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParser
Impl.java:333)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:328)
at com.android.uiautomator.tree.UiHierarchyXmlLoader.parseXml(UiHierarch
yXmlLoader.java:130)
at com.android.uiautomator.UiAutomatorModel.<init>(UiAutomatorModel.java
:51)
at com.android.uiautomator.UiAutomatorHelper.takeSnapshot(UiAutomatorHel
per.java:155)
at com.android.uiautomator.actions.ScreenshotAction$1.run(ScreenshotActi
on.java:91)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Modal
Context.java:121)
null rootnode after parsing.

界面提示:

Error while parsing UI hierarchy XML file: Invalid ui automator hierarchy file.

解决办法:

识别不了微信里面的元素,卸载微信,重新安装微信(版本6.3.8),又可以通过uiautomatorviewer 识别android微信元素了