AndroidViewClient 4.0 encode() takes no keyword arguments

282 views Asked by At

What I did:

Downloaded and unzipped AndroidViewClient v4.0.0 source

Used ant to build

Used the check-import.py example to ensure my ANDROID_VIEW_CLIENT_HOME env variable was properly set.

java -jar bin/androidviewclient-4.0.0.jar displays the commands

java -jar bin/androidviewclient-4.0.0.jar dump crashes with the error:

File "/home/me/dump", line 135, in <module>
   vc.dump(window=options[WINDOW])
File "/path/to/jar/com/dtmilano/android/viewclient.py", line 1831, in dump
File "/path/to/jar/com/dtmilano/android/viewclient.py", line 1560, in setViewsFromUiAutomatorDump
File "/path/to/jar/com/dtmilano/android/viewclient.py", line 1715, in _ViewClient__parseTreeFromUiAutomatorDump
File "/path/to/jar/com/dtmilano/android/viewclient.py", line 1016, in Parse
File "/path/to/jar/com/dtmilano/android/viewclient.py", line 1016, in Parse
TypeError: encode() takes no keyword arguments

I've double-checked the documentation, but couldn't find anything relevant. In addition, I checked my environment variables and experimented with changing them. Nothing changed the error.

Anyone see this error before?

1

There are 1 answers

1
CatShoes On BEST ANSWER

Figured it out.

I was still calling my script from a Jython shell, in which the encode method does not keyword support arguments. Works fine in a real-man's-Python.