最近开始做自动化测试相关工作,部署atx-server 安卓集群管理,记录下部署过程中遇到的问题
一;atxserver不显示设备,使用命令:python main.py --server localhost:4000时报错:
Traceback (most recent call last):
File "D:\provider\atxserver2-android-provider-master\main.py", line 35, in <module>
from device import STATUS_FAIL, STATUS_INIT, STATUS_OKAY, AndroidDevice
File "D:\provider\atxserver2-android-provider-master\device.py", line 17, in <module>
from core import fetching
File "D:\provider\atxserver2-android-provider-master\core\fetching.py", line 8, in <module>
import humanize
ModuleNotFoundError: No module named 'humanize'
由于初次接触,atxserver部署好了,设备一直无法展示,最后才发现是上面报错的问题,直接使用命令:
pip install humanize
安装需要的module即可解决问题;
二,UIAutomator2以及atxserver部署好了之后,记得搞清楚顺序:
1,运行rethinkdb数据库,备注:rethinkab2.4 windows版本下载地址
2,在atxserver目录下运行命令:
python3 main.py --port 4000
3,在atxserver2-android-provider目录下运行命令:
python3 main.py --server localhost:4000
如果python3提示错误就去掉3,还是不行就pip
三,使用Jenkins自动化打包遇到问题解决
1,问题详情:
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\6ec2cf35d937b94920bb7aebb1bf630c\appcompat-1.0.2\res\drawable-xxhdpi-v4\abc_text_select_handle_middle_mtrl_light.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\6ec2cf35d937b94920bb7aebb1bf630c\appcompat-1.0.2\res\layout\abc_action_bar_up_container.xml: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\6ec2cf35d937b94920bb7aebb1bf630c\appcompat-1.0.2\res\drawable-xhdpi-v4\abc_ab_share_pack_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\6ec2cf35d937b94920bb7aebb1bf630c\appcompat-1.0.2\res\anim\abc_tooltip_exit.xml: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\6ec2cf35d937b94920bb7aebb1bf630c\appcompat-1.0.2\res\layout\abc_search_dropdown_item_icons_2line.xml: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\6ec2cf35d937b94920bb7aebb1bf630c\appcompat-1.0.2\res\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\6ec2cf35d937b94920bb7aebb1bf630c\appcompat-1.0.2\res\drawable\abc_btn_colored_material.xml: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-2\files-2.1\6ec2cf35d937b94920bb7aebb1bf630c\appcompat-1.0.2\res\drawable-hdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png: AAPT: error: file not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
2,问题解决:开始一直注意的结尾with gradle7.0,以为是配置问题,频繁在Jenkins中配置gradle路径,后面找到了解决思路,有说在项目gradle.properties设置buildCacheDir的,有说在项目的build.gradle中设置这两句的,aaptOptions.useNewCruncher = false aaptOptions.cruncherEnabled = false,最终不负有心人,可算找到答案了,在Jenkins的系统管理->系统设置 ->全局属性->环境变量中添加全局属性 GRADLE_USER_HOME 值是自定义的一个文件目录,问题就解决了,在这里感觉这位作者,放原贴连接,在此感谢了,可算SUCCESSFUL了