之前可以的,莫名报错。
发现重启计算机和Android Studio Device Monitor后,报错
确定后,特别是对一些复杂的页面(动态)进行过截图,再此就会报错
用uiautomatorviewer.bat运行查看详细错误
org.xml.sax.SAXParseException; systemId: file:/C:/Users/ADMINI~1/AppData/Local/T
emp/uiautomatorviewer_3540125222836262876/dump_1953101848677338404.uix; lineNumb
er: 1; columnNumber: 1; 文件提前结束。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:198)
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:1375)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Driver.next(XMLDocumentScannerImpl.java:1016)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
MLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:568)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParser
Impl.java:302)
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.(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.
搜索关键字,发现是Android遗留bug
https://code.google.com/p/android/issues/detail?id=62906
在红米4.4.4系统上也是第一次可以,后面就不行了。那如果没有L的手机怎么办呢,临时解决办法:
拔掉手机,进入安全模式,删除下列文件
重启电脑,插上手机,切到复杂页面,uiautomatorviewer.bat 保存下uix文件慢慢看吧,不保证一定能成功。最好的方法就是用L的手机了。
PS:换到魅蓝Note2 5.1 系统随便怎么保存基本都是可以的。成功率80%。