如何导入现有的Andr​​oid库项目导入Eclipse工作区 [英] How to import an existing Android Library project into Eclipse workspace

查看:135
本文介绍了如何导入现有的Andr​​oid库项目导入Eclipse工作区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到有强大的支持项目,在那里像这样的: https://github.com/JakeWharton / Android的ViewPagerIndicator

I see there are powerful support projects out there like this one: https://github.com/JakeWharton/Android-ViewPagerIndicator

所有我已经找到了教程和职位描述:

All the tutorials and posts I have found describe:

  • 在哪一个Android库项目是
  • 如何从头创建
  • 如何引用一前一后它已经在你的Eclipse工作区

但我还没有找到如何做一个导入Eclipse这样一个项目的正确步骤。

But I haven't found the correct steps for how to do an import into eclipse for such a project.

我试图创建一个空的Andr​​oid库项目,然后复制过来的文件;然后还试图在Eclipse项目配置链接到库项目根文件夹中的另一个空项目。那些没有工作。

所以我的问题是...什么是对ViewPagerIndicator项目导入我的Eclipse工作区的正确方法?

So my question is .. what's the correct way to import the ViewPagerIndicator project into my Eclipse workspace?

感谢

推荐答案

右键单击工作 - > 导入 - > 现有的Andr​​oid code进入工作区 - > 库文件夹

Right click on Workspace - > Import -> Existing Android Code Into Workspace -> Library Folder

注意:

要避免其他的不便,这样做:

To avoid other inconveniences, do this:

1)一旦已经在您的工作空间,确保该项目被标记为库。右键点击库 - > 属性 - > 安卓 - >检查是库

1) Once is already in your Workspace, make sure that the project is marked as "Library." Right click on Library -> properties -> Android -> Check Is Library

2)在进口时,更改文件夹的名称。请指定的东西不仅仅是图书馆的不同。在GitHub上的项目通常会这样的。

2) At the time of importing, change the name of the folder. Please, specify something different than just "library". Projects on github usually come that way.

3)确保每个文件的文件夹中。举例来说,Eclipse将不会导入任何东西,如果 project.properties 不在库文件夹中。在类似的情况下,Eclipse中可以导入项目,但它不会创建R.java文件,如果有任何缺失或者有在图书馆的布局错误。

3) Make sure that every file is in the folder. For instance, Eclipse won't import anything if project.properties is not inside the Library folder. In a similar situation, Eclipse could import the project, but it would not create the R.java file if something is missing or there are errors in the layouts of the library.

4)确保所有的依赖关系匹配您的项目。举例来说,如果某个库的需求 Android的支持 - v4.jar ,确保两个(项目和库)共享该文件的版本相同。再次属性 - > Java构建路径 - > - > 添加删除

4) Make sure that all dependencies match with your project. For instance, if certain library needs android-support-v4.jar, make sure that both (project and library) share the same version of the file. Once again properties -> Java Build Path -> Libraries -> Add or remove Jars

5)为了使您的项目依赖进口图书馆,右键点击项目 - > 属性 - > 安卓 - >滚动直到结束,并添加导入库

5) To make your project dependent of the imported library, Right Click on the project -> properties -> Android -> scroll until the end and add the imported library.

这篇关于如何导入现有的Andr​​oid库项目导入Eclipse工作区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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