添加的Andr​​oid库项目到Android项目prevents蚂蚁从建筑 [英] Adding android library project to an android project prevents Ant from building

查看:121
本文介绍了添加的Andr​​oid库项目到Android项目prevents蚂蚁从建筑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加一个机器人库项目到我的Andr​​oid应用程序(在这种情况下,Beintoo)。不是我的;这是一个外部库。但是,它没有附带一个build.xml。构建在Eclipse中工作正常,但是当我试图建立我与蚂蚁的应用程序,我得到这样的:

I'm adding an android library project to my android app (in this case, Beintoo). It's not mine; It's an external library. However, it doesn't come with a build.xml. Building in Eclipse works fine, but when I attempt to build my app with ant, I get this:

BUILD FAILED
C:\Sandbox\MyProject\build.xml:110: The following error occurred while executing this line:
C:\Sandbox\MyProject\build.xml:41: The following error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:515: Invalid file: C:\Git\Beintoo-Android\beintoo-android-sdk\BeintooSDK\build.xml

这是完全正确的。该文件是无效的,因为它不存在。我不知道该怎么做才能安全地添加它,也没有如果这甚至是个好主意。

It's perfectly true. The file is invalid, because it doesn't exist. I wouldn't know what to do to add it safely, nor if that's even a good idea.

我了解到,我不能简单地建库项目,装入瓶内。我怎样才能让我的项目,以建立在蚂蚁与此库的项目?

I have learnt that I can't simply build the library project into a jar. How can I get my project to build in Ant with this library project?

推荐答案

好了,所以,错误454的回答很接近,但不完全正确。由于Android工具的R14,每个图书馆项目必须有它自己的build.xml,如果它是由Ant进行构建,因为这里要注意:

Ok, so, Error 454's answer was close, but not quite right. Since r14 of Android Tools, every library project must have it's own build.xml if it is to be built by Ant, as noted here:

<一个href="https://groups.google.com/forum/?fromgroups#!topic/adt-dev/Z2e3dY-3Ma0">https://groups.google.com/forum/?fromgroups#!topic/adt-dev/Z2e3dY-3Ma0

在库项目运行 Android的更新LIB-项目(其中,因为错误454的笔记,是原本应该在PATH中Android的SDK / tools文件夹)会增加一个通用build.xml文件,并允许主体工程建设。

Running android update lib-project (which, as Error 454 notes, is in the android-sdk/tools folder which should be in PATH) on the library project will add a generic build.xml, and allow the main project to build.

这篇关于添加的Andr​​oid库项目到Android项目prevents蚂蚁从建筑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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