[GH-ISSUE #92] FIXED - uiautomator2.GatewayError - Raspberry Pi & Sony Experia by USB - ANDROID VERSION needs to be more than 4.4 #530

Closed
opened 2026-03-13 21:50:11 +03:00 by kerem · 3 comments
Owner

Originally created by @soulpawa on GitHub (Aug 24, 2020).
Original GitHub issue: https://github.com/alexal1/Insomniac/issues/92

Hi, using my Raspberry Pi 3B I'm getting this error

Insomniac v2.0.0

[08/24 20:40:47] Connected devices via adb: 1. That's ok.
[08/24 20:40:48] Action: interact with @pepitomix

-------- START: 2020-08-24 20:40:48.022447 --------
[08/24 20:40:48] Open Instagram app
[08/24 20:40:48] Sleep for 2 seconds
[08/24 20:40:50] Press profile
[D 200824 20:40:51 init:598] kill process(ps): uiautomator
[D 200824 20:40:54 init:617] uiautomator-v2 is starting ... left: 40.0s
[I 200824 20:40:57 init:570] restart-uiautomator since "uiautomator2.GatewayError(gateway error, time used 0.1s)"
[D 200824 20:40:58 init:598] kill process(ps): uiautomator
[D 200824 20:41:00 init:652] grant permissions
[D 200824 20:41:04 init:617] uiautomator-v2 is starting ... left: 40.0s
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 441, in _jsonrpc_retry_call
return self._jsonrpc_call(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 478, in _jsonrpc_call
(time.time() - request_start))
uiautomator2.exceptions.GatewayError: uiautomator2.GatewayError(gateway error, time used 0.1s)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "insomniac.py", line 421, in
main()
File "insomniac.py", line 93, in main
session_state.my_following_count = get_my_profile_info(device)
File "/home/pi/Insomniac/src/action_get_my_profile_info.py", line 9, in get_my_profile_info
navigate(device, Tabs.PROFILE)
File "/home/pi/Insomniac/src/navigation.py", line 16, in navigate
button.click(timeout=UI_TIMEOUT)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/_selector.py", line 150, in click
self.must_wait(timeout=timeout)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/_selector.py", line 344, in must_wait
if not self.wait(exists, timeout):
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/_selector.py", line 316, in wait
http_timeout=http_wait)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 435, in call
http_timeout)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 445, in _jsonrpc_retry_call
self.reset_uiautomator(str(e)) # uiautomator可能出问题了,强制重启一下
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 589, in reset_uiautomator
depth=depth + 1)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 589, in reset_uiautomator
depth=depth + 1)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 566, in reset_uiautomator
"adb shell am instrument -w -r -e debug false -e class com.github.uiautomator.stub.Stub com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner",
OSError: [Errno Uiautomator started failed.] uiautomator2.GatewayError(gateway error, time used 0.1s): 'https://github.com/openatx/uiautomator2/wiki/Common-issues'

any idea of what could be?

Originally created by @soulpawa on GitHub (Aug 24, 2020). Original GitHub issue: https://github.com/alexal1/Insomniac/issues/92 Hi, using my Raspberry Pi 3B I'm getting this error Insomniac v2.0.0 [08/24 20:40:47] Connected devices via adb: 1. That's ok. [08/24 20:40:48] Action: interact with @pepitomix -------- START: 2020-08-24 20:40:48.022447 -------- [08/24 20:40:48] Open Instagram app [08/24 20:40:48] Sleep for 2 seconds [08/24 20:40:50] Press profile [D 200824 20:40:51 __init__:598] kill process(ps): uiautomator [D 200824 20:40:54 __init__:617] uiautomator-v2 is starting ... left: 40.0s [I 200824 20:40:57 __init__:570] restart-uiautomator since "uiautomator2.GatewayError(gateway error, time used 0.1s)" [D 200824 20:40:58 __init__:598] kill process(ps): uiautomator [D 200824 20:41:00 __init__:652] grant permissions [D 200824 20:41:04 __init__:617] uiautomator-v2 is starting ... left: 40.0s Traceback (most recent call last): File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/__init__.py", line 441, in _jsonrpc_retry_call return self._jsonrpc_call(*args, **kwargs) File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/__init__.py", line 478, in _jsonrpc_call (time.time() - request_start)) uiautomator2.exceptions.GatewayError: uiautomator2.GatewayError(gateway error, time used 0.1s) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "insomniac.py", line 421, in <module> main() File "insomniac.py", line 93, in main session_state.my_following_count = get_my_profile_info(device) File "/home/pi/Insomniac/src/action_get_my_profile_info.py", line 9, in get_my_profile_info navigate(device, Tabs.PROFILE) File "/home/pi/Insomniac/src/navigation.py", line 16, in navigate button.click(timeout=UI_TIMEOUT) File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/_selector.py", line 150, in click self.must_wait(timeout=timeout) File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/_selector.py", line 344, in must_wait if not self.wait(exists, timeout): File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/_selector.py", line 316, in wait http_timeout=http_wait) File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/__init__.py", line 435, in __call__ http_timeout) File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/__init__.py", line 445, in _jsonrpc_retry_call self.reset_uiautomator(str(e)) # uiautomator可能出问题了,强制重启一下 File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/__init__.py", line 589, in reset_uiautomator depth=depth + 1) File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/__init__.py", line 589, in reset_uiautomator depth=depth + 1) File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/__init__.py", line 566, in reset_uiautomator "adb shell am instrument -w -r -e debug false -e class com.github.uiautomator.stub.Stub com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner", OSError: [Errno Uiautomator started failed.] uiautomator2.GatewayError(gateway error, time used 0.1s): 'https://github.com/openatx/uiautomator2/wiki/Common-issues' any idea of what could be?
kerem closed this issue 2026-03-13 21:50:17 +03:00
Author
Owner

@alexal1 commented on GitHub (Aug 25, 2020):

I think ATX app installed by uiautomator2 might be incompatible with your device's processor. Does v1 of the script work?

<!-- gh-comment-id:679852832 --> @alexal1 commented on GitHub (Aug 25, 2020): I think ATX app installed by uiautomator2 might be incompatible with your device's processor. Does v1 of the script work?
Author
Owner

@gvmturl commented on GitHub (Aug 25, 2020):

Working on my raspberry pi 3b +

I will try Xperia soon as possible and let you know how it goes!

<!-- gh-comment-id:679875264 --> @gvmturl commented on GitHub (Aug 25, 2020): Working on my raspberry pi 3b + I will try Xperia soon as possible and let you know how it goes!
Author
Owner

@soulpawa commented on GitHub (Aug 25, 2020):

FIXED as the my Android Version was 4.3 and uiautomator2 is not compatible, now with an Android version 5.5 is working like a charm the bot.

<!-- gh-comment-id:680238999 --> @soulpawa commented on GitHub (Aug 25, 2020): FIXED as the my Android Version was 4.3 and uiautomator2 is not compatible, now with an Android version 5.5 is working like a charm the bot.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Insomniac#530
No description provided.