UiAutomator 新手求指导,uiautomator 脚本,用 ant build 时遇到的问题

John_D · 2016年11月29日 · 最后由 由迪 回复于 2016年12月26日 · 1500 次阅读

我通过 android create uitest-project 生成一个 build 文件后,用 ant build 命令打包,可是报:ant build 具体代码如下:

:ant build
Buildfile: E:\Eclips\Demo\build.xml
-check-env:
 [checkenv] Android SDK Tools Revision 25.2.2
 [checkenv] Installed at D:\android sdk
-build-setup:
[getbuildtools] Using latest Build Tools: 21.0.2
     [echo] Resolving Build Target for Uiautom...
[getuitarget] Project Target:   Android 5.1.1
[getuitarget] API level:        22
     [echo] ----------
     [echo] Creating output directories if needed...
-pre-compile:
compile:
-post-compile:
-dex:
      [dex] input: E:\Eclips\Demo\bin\classes
      [dex] Converting compiled files and external libraries into E:\Eclips\Demo\bin\classes.dex...
       [dx] no classfiles specified
BUILD FAILED
D:\android sdk\tools\ant\uibuild.xml:198: null returned: 1
Total time: 0 seconds

然后,uibuild.xml 文件 198 处代码为:

193 <!-- Converts this project's .class files into .dex files -->
194<target name="-dex" depends="compile, -post-compile">
195 <dex executable="${dx}"
196 output="${intermediate.dex.file}"
197 nolocals="@{nolocals}"
198 verbose="${verbose}">
199 <path path="${out.classes.absolute.dir}"/>

,请大神们指导

共收到 3 条回复 时间 点赞

看下你的用例方法名是不是以 test 开头

还是用 2.0 吧,省的再学一遍

你的 SDK Tools 的版本太高了,你把他降到 Build Tools: 21.0.2 版本就可以了,我之前也遇到过这个坑爹的问题,搞了 3 天才好

需要 登录 後方可回應,如果你還沒有帳號按這裡 注册