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

3.2.3 connect时出错(已经是u2.jar):Failed to load class "org.slf4j.impl.StaticLoggerBinder" #1035

Open
delta-hell opened this issue Sep 5, 2024 · 3 comments

Comments

@delta-hell
Copy link

3.2.3版本,连接时报错,详细信息如下:

Traceback (most recent call last):
File "D:/mycode/mine/cv/ui.py", line 3, in
d = u2.connect() # 一个设备时, read env-var ANDROID_SERIAL
File "D:\mycode\mine\venv\lib\site-packages\uiautomator2_init_.py", line 1079, in connect
return connect_usb(serial)
File "D:\mycode\mine\venv\lib\site-packages\uiautomator2_init_.py", line 1095, in connect_usb
return Device(serial)
File "D:\mycode\mine\venv\lib\site-packages\uiautomator2_init_.py", line 69, in init
BasicUiautomatorServer.init(self, self._dev)
File "D:\mycode\mine\venv\lib\site-packages\uiautomator2\core.py", line 170, in init
self.start_uiautomator()
File "D:\mycode\mine\venv\lib\site-packages\uiautomator2\core.py", line 195, in start_uiautomator
self._wait_ready()
File "D:\mycode\mine\venv\lib\site-packages\uiautomator2\core.py", line 219, in _wait_ready
self._wait_app_process_ready(launch_timeout)
File "D:\mycode\mine\venv\lib\site-packages\uiautomator2\core.py", line 245, in _wait_app_process_ready
raise LaunchUiAutomationError("server not ready", output_buffer)
uiautomator2.exceptions.LaunchUiAutomationError: ('server not ready', '[server] INFO: [UiAutomator2Server] Starting Server\nSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".\nSLF4J: Defaulting to no-operation (NOP) logger implementation\nSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\n[server] INFO: clipboardManager inited\n[server] INFO: [UiAutomator2Server] Starting Server\nSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".\nSLF4J: Defaulting to no-operation (NOP) logger implementation\nSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\n[server] INFO: clipboardManager inited\n[server] INFO: [UiAutomator2Server] Starting Server\nSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".\nSLF4J: Defaulting to no-operation (NOP) logger implementation\nSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\n[server] INFO: clipboardManager inited\n[server] INFO: [UiAutomator2Server] Starting Server\nSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".\nSLF4J: Defaulting to no-operation (NOP) logger implementation\nSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.\n[server] INFO: clipboardManager inited\n')

Process finished with exit code 1

@codeskyblue
Copy link
Member

请提供一下具体的设备型号

@nzmxd
Copy link

nzmxd commented Sep 24, 2024

请提供一下具体的设备型号
机型一加8T
OnePlus8T:/data/local/tmp # CLASSPATH=/data/local/tmp/u2.jar app_process / com.wetest.uia2.Main
[server] INFO: [UiAutomator2Server] Starting Server
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[server] INFO: clipboardManager inited

@delta-hell
Copy link
Author

定位了一下,是使用代理的原因导致网络请求没法转发到手机上,脚本前面加上
os.environ['NO_PROXY'] = '127.0.0.1'
这样的设置可以解决。

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