Android的蚂蚁uibuild.xml:198:空返回:1 [英] android ant uibuild.xml:198: null returned: 1

查看:1652
本文介绍了Android的蚂蚁uibuild.xml:198:空返回:1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的蚂蚁和Android uiautomator。当使用Ant来构建我的测试程序我得到:

I am new to ant and Android uiautomator. When using ant to build my testing program I get:

-dex:
      [dex] input: c:\Eclipse\workspace\Android\bin\classes
      [dex] Converting compiled files and external libraries into c:\Eclipse\wor
kspace\Android\bin\classes.dex...
       [dx] no classfiles specified
BUILD FAILED
    C:\Android\sdk\tools\ant\uibuild.xml:198: null returned: 1

这是对样品测试code。在:的http:// developer.android.com/tool​​s/testing/testing_ui.html#sample

This is on the sample test code at: http://developer.android.com/tools/testing/testing_ui.html#sample

从运行输出全了机器人创造uitest ...和Ant构建命令如下:

The full output from running the 'android create uitest...' and 'ant build' commands follows:

c:\Eclipse\workspace\Android>android create uitest-project -n AllAppsTest -t 7 -
p C:\Eclipse\workspace\Android\
Updated file C:\Eclipse\workspace\Android\build.xml

c:\Eclipse\workspace\Android>ant build
Buildfile: c:\Eclipse\workspace\Android\build.xml

-check-env:
[checkenv] Android SDK Tools Revision 23.0.2
[checkenv] Installed at C:\Android\sdk

-build-setup:
[getbuildtools] Using latest Build Tools: 19.1.0
     [echo] Resolving Build Target for AllAppsTest...
[getuitarget] Project Target:   Android 4.2.2
[getuitarget] API level:        17
     [echo] ----------
     [echo] Creating output directories if needed...

-pre-compile:

compile:

-post-compile:

-dex:
      [dex] input: c:\Eclipse\workspace\Android\bin\classes
      [dex] Converting compiled files and external libraries into c:\Eclipse\wor
kspace\Android\bin\classes.dex...
       [dx] no classfiles specified

BUILD FAILED
C:\Android\sdk\tools\ant\uibuild.xml:198: null returned: 1

Total time: 0 seconds

我的问题是类似 Android的Ant构建项目失败这似乎不有一个答案(或至少一个,我可以从反应descern

My problem is similar to Android ant build project failure which didn't seem to have an answer (or at least one that I could descern from the responses.

我不能张贴图片(没有足够的魔力还没有),但我的测试项目设置为:

I can't post an image (not enough mojo yet) but my test project is set up as:

AllAppsTest
  src 
    com.uia.example.my
      LaunchSettings.java
   JRE System Library[JavaSE-1.6]  (there are number of jar files here but I am not
                                    listing them here)
   Referenced Libraries
      android.jar
      uiautomator.jar
   JUnit 4

我执行以下操作:

I executed the following:

c:\Eclipse\workspace\Android>android create uitest-project -n AllAppsTest -t 7 -
p C:\Eclipse\workspace\Android\
Updated file C:\Eclipse\workspace\Android\build.xml

c:\Eclipse\workspace\Android>ant build
Buildfile: c:\Eclipse\workspace\Android\build.xml

这导致在这篇文章的顶部的Ant构建错误输出。

Which resulted in the 'ant build' error output at the top of this post.

任何想法?

感谢

埃里克

推荐答案

不知道这是犹太回答我的问题,但...

Not sure this is kosher answering my own question but...

我相信这是在文档中执行build.xml文件错误(或创建步骤)。该build.xml文件必须复制到该项目目录,在我的情况AllAppsTest,和Ant构建命令从那里执行。

I believe there is an error in the documentation (or the create step) for executing the build.xml file. The build.xml must be copied to the project directory, in my case AllAppsTest, and the 'ant build' command executed from there.

所以,事件发生的顺序来得到这个工作(在Windows命令窗口):

So the sequence of events to get this to work (in Windows command window):


  1. 运行机器人制造命令

  1. Run the 'android create' command

C:\\ Eclipse的\\工作区\\的Andr​​oid> Android的创建uitest项目-n AllAppsTest -t 7 -
p C:\\ Eclipse的\\工作区\\的Andr​​oid \\

c:\Eclipse\workspace\Android>android create uitest-project -n AllAppsTest -t 7 - p C:\Eclipse\workspace\Android\

切换到AllAppsTest目录

Switch to the AllAppsTest directory

CD AllAppsTest

cd AllAppsTest

build.xml文件从父目录复制

Copy the build.xml file from the parent directory

复制../build.xml结果
  (由于某种原因副本local.properties和project.properties也)

copy ../build.xml
(which for some reason copies local.properties and project.properties also)

运行Ant构建命令

当我第一次尝试这种构建失败,因为它不喜欢的单引号和双引号我有是在注释行。不知道为什么,这是但我把他们赶走和Ant构建工作确定。

When I first tried this the build failed as it didn't like the single and double quotes I had that were on comment lines. Not sure why that was but I removed them and the ant build worked OK.

这篇关于Android的蚂蚁uibuild.xml:198:空返回:1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆