ValueError: received does not contain valid XML: Killed
Hello,
When I try to dump the view hierarchy I have the following error. Any idea on how to fix it?
➜ ~ dump -x
Traceback (most recent call last):
File "/Users/g123k/.pyenv/versions/3.10.4/lib/python3.10/site-packages/com/dtmilano/android/viewclient.py", line 3392, in __parseTreeFromUiAutomatorDump
start_xml_index = receivedXml.index("<?xml")
ValueError: substring not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/g123k/.pyenv/versions/3.10.4/bin/dump", line 221, in <module>
vc.dump(window=options[WINDOW])
File "/Users/g123k/.pyenv/versions/3.10.4/lib/python3.10/site-packages/com/dtmilano/android/viewclient.py", line 3596, in dump
self.setViewsFromUiAutomatorDump(received)
File "/Users/g123k/.pyenv/versions/3.10.4/lib/python3.10/site-packages/com/dtmilano/android/viewclient.py", line 3178, in setViewsFromUiAutomatorDump
self.__parseTreeFromUiAutomatorDump(received)
File "/Users/g123k/.pyenv/versions/3.10.4/lib/python3.10/site-packages/com/dtmilano/android/viewclient.py", line 3395, in __parseTreeFromUiAutomatorDump
raise ValueError("received does not contain valid XML: " + receivedXml)
ValueError: received does not contain valid XML: Killed
It's due to a problem with uiautomator dump, which is producing and empty response (that's why <?xml is not found).
You can try to manually invoke uiautomator dump in your situation to analyze the response, whether it's empty or an error message.
Using a different backend for AndroidViewClient would help. You can try https://github.com/dtmilano/CulebraTester2-public which works in many cases where uiautomator does not.
Hi @dtmilano , I receive same error running AndroidViewClient on AWS ec2 instance
I could not find
uiautomatorin android sdk instead had to run uiautomatorviewer dump
Xlib extension RANDR missing on display :1
Do you know what might cause this issue ?
@sooraj-sizon-pj you didn't describe what you are trying to achieve and how?
what devices do you have connected to the EC2 instance and how?
what's the output of adb devices ?
The error shows the XML output was null.
@sooraj-sizon-pj you didn't describe what you are trying to achieve and how? what devices do you have connected to the EC2 instance and how? what's the output of
adb devices?
Device is custom android emulator x86_64 running on AWS EC2 , I have same Emulator setup on my local env where AndroidViewClient works perfectly Where as on EC2 with same Automation script it goes through a few screens of android setupwizard and able to click on buttons and views and fails with this crash on like 4th or 5th step .
The emulator is running custom system-images build from AOSP A11_r1 tag has custom setup wizard another system app and a system service running very early at boot.
@sooraj-sizon-pj please create another issue so we can track it properly. It's not exactly related to this one as several of the conditions are different.
@sooraj-sizon-pj please create another issue so we can track it properly. It's not exactly related to this one as several of the conditions are different.
+1 created a new issue https://github.com/dtmilano/AndroidViewClient/issues/320