Tencent / GameAISDK

基于图像的游戏AI自动化框架
Other
2.09k stars 443 forks source link

连接手机出错,双击序列号直接退出界面 #30

Open leviJ123 opened 3 years ago

leviJ123 commented 3 years ago

报错如下: Traceback (most recent call last): File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAdapter.py", line 36, in init from .deviceAPI.mobileDevice.android.androidDevice import AndroidDevice File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/androidDevice.py", line 18, in from .androidDeviceAPI import AndroidDeviceAPI File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/androidDeviceAPI.py", line 12, in from .devicePlatform.WrappedPlatform import PlatformWrapper File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/devicePlatform/WrappedPlatform.py", line 18, in from ..plugin.Platform_plugin.PlatformWeTest import AdbTool File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/plugin/Platform_plugin/PlatformWeTest/init.py", line 18, in from .demo_ubuntu16.PlatformWeTest import PlatformWeTest ImportError: bad magic number in 'src.WrappedDeviceAPI.deviceAPI.mobileDevice.android.plugin.Platform_plugin.PlatformWeTest.demo_ubuntu16': b'\x16\r\r\n'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/op_tree.py", line 293, in double_click_right_tree ProjectNode().update_right_tree() File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/tree/project_node.py", line 334, in update_right_tree self.select_phone() File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/tree/project_node.py", line 381, in select_phone self._init_phone(item, serial) File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/tree/project_node.py", line 850, in _init_phone long_edge=self.media_source.long_edge) File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/canvas/data_source.py", line 77, in init_phone self.phone = DeviceAdapter(device_type, platform=platform) File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAdapter.py", line 47, in init raise Exception(err) Exception: bad magic number in 'src.WrappedDeviceAPI.deviceAPI.mobileDevice.android.plugin.Platform_plugin.PlatformWeTest.demo_ubuntu16': b'\x16\r\r\n'

是因为编译python 版本问题吗?可是版本用的3.6.2阿

836304831 commented 3 years ago

用的哪种模式启动的啊,是win10+docker,还是纯ubutun呢? 看你的报错事win10+docker的模式,win10拉代码时需要设置换行符的配置,因为默认git拉下来的代码会将换行符转换成windows下的,而docker事ubutnu的镜像就可能导致上述的问题。

xdien commented 3 years ago

I also have similar problem. i use gentoo not ubuntu(not docker), i install all packages according to instructions in pyenv. If I make changes, which file should I edit? I don't see any abnormalities in the lines of source code where it throws an error.

xdien commented 3 years ago

problem has been resolved. because .pyc files are files that have been compiled with a different version of python. I have added the library source code here https://github.com/xdien/GameAISDK/commit/cc8e5732a718c7eb45450baa9d84301d9bd3c207

hhuiwang commented 3 years ago

相同的问题,请问解决了没有呀。。头都要炸了。说是PYC编译的版本不一致,官方不是说的是3.6.2吗。都重装好几遍了,天啊!

hhuiwang commented 3 years ago

报错如下: Traceback (most recent call last): File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAdapter.py", line 36, in init from .deviceAPI.mobileDevice.android. androidDevice import AndroidDevice File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/androidDevice.py", line 18, in from .androidDeviceAPI import AndroidDeviceAPI File "/home/hiqos /Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/androidDeviceAPI.py", line 12, in from .devicePlatform.WrappedPlatform import PlatformWrapper 文件“/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/devicePlatform/WrappedPlatform.py”,第18行, 从..plugin.Platform_plugin.PlatformWeTest导入AdbTool 文件“ /home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/plugin/Platform_plugin/PlatformWeTest/ init .py", line 18, in from .demo_ubuntu16.PlatformWeTest import PlatformWeTest ImportError: bad 'src.WrappedDeviceAPI.deviceAPI.mobileDevice.android.plugin.Platform_plugin.PlatformWeTest.demo_ubuntu16'中的幻数:b'\x16\r\r\n'

在处理上述异常的过程中,又发生了一个异常:

回溯(最近一次调用): 文件“/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/op_tree.py”,第 293 行,在 double_click_right_tree ProjectNode().update_right_tree() 文件“/home /hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/tree/project_node.py”,第 334 行,在 update_right_tree self.select_phone() 文件中“/home/hiqos/Data/work/GameAISDK/tools/SDKTool /src/ui/tree/project_node.py", line 381, in select_phone self._init_phone(item, serial) File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/tree/project_node. py”,第 850 行,在 _init_phone long_edge=self.media_source.long_edge) 文件“/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/canvas/data_source.py”,第 77 行,在 init_phone 中 self.phone = DeviceAdapter(device_type, platform=platform) File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAdapter.py", line 47, in init raise Exception(err) Exception: 'src.WrappedDeviceAPI.deviceAPI.mobileDevice.android.plugin.Platform_plugin.PlatformWeTest.demo_ubuntu16'中的错误幻数:b'\x16\r\r\n'

是因为编译python版本问题吗?但是版本用的3.6.2阿

请教请教,,问题解决了没有啊,都说这个问题是PYC编译的版本和使用版本不一致导致的,官方说的是用的PY3.6.2编译的,可是安装的是3.6.2版本的还是出现这个问题,

leviJ123 commented 3 years ago

报错如下: Traceback (most recent call last): File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAdapter.py", line 36, in init from .deviceAPI.mobileDevice.android. androidDevice import AndroidDevice File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/androidDevice.py", line 18, in from .androidDeviceAPI import AndroidDeviceAPI File "/home/hiqos /Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/androidDeviceAPI.py", line 12, in from .devicePlatform.WrappedPlatform import PlatformWrapper 文件“/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/devicePlatform/WrappedPlatform.py”,第18行, 从..plugin.Platform_plugin.PlatformWeTest导入AdbTool 文件“ /home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAPI/mobileDevice/android/plugin/Platform_plugin/PlatformWeTest/ init .py", line 18, in from .demo_ubuntu16.PlatformWeTest import PlatformWeTest ImportError: bad 'src.WrappedDeviceAPI.deviceAPI.mobileDevice.android.plugin.Platform_plugin.PlatformWeTest.demo_ubuntu16'中的幻数:b'\x16\r\r\n' 在处理上述异常的过程中,又发生了一个异常: 回溯(最近一次调用): 文件“/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/op_tree.py”,第293行,在double_click_right_tree ProjectNode().update_right_tree() 文件“/home /hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/tree/project_node.py”,第334行,在update_right_tree self.select_phone() 文件中“/home/hiqos/Data/work/GameAISDK/tools /SDKTool /src/ui/tree/project_node.py", line 381, in select_phone self._init_phone(item, serial) File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/tree/项目节点。py”,第 850 行,在 _init_phone long_edge=self.media_source.long_edge) 文件“/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/ui/canvas/data_source.py”,第 77 行,在init_phone 中 self.phone = DeviceAdapter(device_type, platform=platform) File "/home/hiqos/Data/work/GameAISDK/tools/SDKTool/src/WrappedDeviceAPI/deviceAdapter.py", line 47, in init raise Exception(err) Exception: 'src.WrappedDeviceAPI.deviceAPI.mobileDevice.android.plugin.Platform_plugin.PlatformWeTest.demo_ubuntu16'中的错误幻数:b'\x16\r\r\n' 是因为要编译 python 版本吗?但版本是 3.6.2 阿

教教请教,问题解决了没有啊,都说这个问题是 PYC 编译的版本和使用版本,请引导的,官方不是用的 PY3.6.2 编译的,但是安装的是 3.6.2 版本的还是出现了问题,

3.6.2是windows系统的要求,ubuntu系统如果是16.04版本自带3.5,用自带python版本编译不会报错。 如果ubuntu版本高了,自带python版本也会高,需要重新下载python3.5,并且编译的时候有很多python版本问题需要自行修改。 所以我最后是用了ubuntu16.04,用他自动部署工具直接部署,省的麻烦。但后面也遇到了很多问题,只能慢慢摸索