在eclipse中,无法在另一个android项目中引用一个android库项目 [英] In eclipse, unable to reference an android library project in another android project

查看:37
本文介绍了在eclipse中,无法在另一个android项目中引用一个android库项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在写这个问题时,我设法解决了它,所以为了其他人的利益,在这里重复一遍.这是最初的问题:

As I was writing up this question I managed to solve it so repeat it here for the benefit of others. Here is the initial problem:

我创建了一个非常简单的库项目,我想在另一个项目中引用它.我以前做过这件事,没有任何问题,所以不太确定为什么这次不起作用.我有:

I have created a very simple library project which I want to reference in another project. I have done this previously with no problems so not really sure why it is not working this time. I have:

  1. 通过项目属性标记了库项目.default.properties 文件具有以下设置:android.library=true

在我的另一个项目中,通过项目属性添加了对我的库项目的引用.default.properties 文件按预期添加了引用,即 android.library.reference.1=K:/android_test_ws/applicationRegistrar

In my other project added reference to my library project via project properties. The default.properties file has the reference added as expected ie android.library.reference.1=K:/android_test_ws/applicationRegistrar

所引用的库项目的绿色勾从绿色开始,然后变为红色.

The green tick against the referenced library project starts off green and then changes to a red cross.

这意味着库项目中一定有错误/缺失,但我不知道是什么.这次我的图书馆项目比我创建的前一个项目简单得多.

This implies that there must be something wrong / missing from the library project but I don't know what. My library project on this occasion is MUCH simpler than the previous one I created.

推荐答案

OK 这是我在文件系统中查找引用项目(不是库)的 default.properies 文件时找到的解决方案.尽管引用项目与库项目位于同一个 eclipse 工作区中,但实际文件位于文件系统中的其他位置,即它们不在库项目的同一个父文件夹中.一旦我将引用项目与库项目放在同一个物理文件夹中,一切顺利.

OK Here is the solution which I found when I was looking for the default.properies file of the referencing project (not the library) in my file system. Although the referencing project was in the same eclipse workspace as the library project, the actual files were somewhere else in the file system ie they were'nt in the same parent folder of the library project. As soon as I placed the referencing project in the same physical folder as the library project it all went fine.

我猜这一定与 android 在封面下使用蚂蚁有关.

I guess that this must be something to do with android using ant underneath the covers.

项目名称需要与文件系统上的文件夹名称匹配.您在 Project Properties->Android->Library Reference 中看到的是相对文件系统路径.

The project name needs match the folder name on the file system. What you are seeing in the Project Properties->Android->Library Reference is a relative file system path.

这篇关于在eclipse中,无法在另一个android项目中引用一个android库项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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