Android的测试项目失败打造蚂蚁下,确定在Eclipse [英] Android test project fails to build under Ant, OK in Eclipse

查看:171
本文介绍了Android的测试项目失败打造蚂蚁下,确定在Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个CI构建服务器的一个Android应用程序项目及其JUnit测试项目。我已经生成相应的的build.xml 为应用程序和测试项目文件。

这两个项目建设和Eclipse下运行正常。

然而,当我尝试做蚂蚁调试对测试项目的没有的最早建成使用Eclipse两个项目,我得到几个 [javac的] 错误说法错误:无法找到符号这是指类应用项目

我觉得这是Eclipse可以在类路径和类路径蚂蚁正在使用...

之间的差异

我如何告诉Ant哪里可以找到应用程序类?

这似乎在Android默认的的build.xml 定义了所有的目标,所以我想知道如何将在应用程序项目的构建适当的参考的.xml ...而无需从头开始构建文件。



  1. Tried出口从Eclipse中Ant构建文件;失败建设项目任。


解决方案

什么似乎工作就是重新运行:

Android的更新测试项目-m ../../app_project/ -p。

测试项目范围内。

它所做的唯一的变化是创建一个 ant.properties 一个非注释行文件:

tested.project.dir = .. / .. / app_project /

现在,这一切工作顺顺当当Eclipse之外!

I am trying to set up a CI build server for an Android app project and its JUnit test project. I've generated the appropriate build.xml files for both app and test projects.

Both projects build and execute fine under Eclipse.

However, when I try to do ant debug on the test project without having first built both projects with Eclipse, I get several [javac] errors saying error: cannot find symbol which refer to classes in the app project.

I think this is a difference between the classpath that Eclipse sees and the classpath that Ant is using...

How do I tell Ant where to find the app classes?

It seems the Android default build.xml defines all the targets, so I was wondering how to insert the appropriate reference in the app project's build.xml... rather than having to start the build file from scratch.


  1. Tried exporting the Ant build file from Eclipse; that fails to build either project.

解决方案

What seems to work is to re-run:

android update test-project -m ../../app_project/ -p .

within the test project.

The only change it made was to create an ant.properties file with one non-comment line:

tested.project.dir=../../app_project/

And now it all works swimmingly outside of Eclipse!

这篇关于Android的测试项目失败打造蚂蚁下,确定在Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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