Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: received does not contain valid XML: Killed #307

Closed
g123k opened this issue Sep 2, 2022 · 7 comments
Closed

ValueError: received does not contain valid XML: Killed #307

g123k opened this issue Sep 2, 2022 · 7 comments

Comments

@g123k
Copy link

g123k commented Sep 2, 2022

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
@dtmilano
Copy link
Owner

dtmilano commented Sep 6, 2022

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.

@dtmilano dtmilano closed this as completed Oct 8, 2022
@sooraj-sizon-pj
Copy link

Hi @dtmilano , I receive same error running AndroidViewClient on AWS ec2 instance
Screenshot from 2023-10-31 13-07-36
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 ?

@dtmilano
Copy link
Owner

dtmilano commented Nov 4, 2023

@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 ?

@dtmilano
Copy link
Owner

dtmilano commented Nov 4, 2023

The error shows the XML output was null.

@sooraj-sizon-pj
Copy link

@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.

@dtmilano
Copy link
Owner

dtmilano commented Nov 6, 2023

@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
Copy link

@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 #320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants