eclipse 无法将库添加到我的 android 项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8964035/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't add library to my android project
提问by Elad92
I'm creating a new app and I want to use some libraries like this: https://github.com/JakeWharton/Android-ViewPagerIndicator
我正在创建一个新的应用程序,我想使用一些这样的库:https: //github.com/JakeWharton/Android-ViewPagerIndicator
I had downloaded this library, added it to my workspace using New Android Project -> Create from existig source.
Went to properties > android, and checked Is Library
.
Then I went to properties > android in my app project, and clicked add on the Libraries section, and chose the library, and It show me the library with a green V near it.
I've clicked ok, but couldn't use the library so I've opened the properties > android again, and there was a red cross near the library, and '?' under the "Project" column.
我已经下载了这个库,并使用 New Android Project -> Create from existing source 将它添加到我的工作区。转到属性> android,并检查Is Library
. 然后我转到我的应用程序项目中的属性> android,然后单击“库”部分上的“添加”,然后选择该库,它向我显示了靠近它的绿色 V 的库。我点击了确定,但无法使用库,所以我再次打开了属性 > android,库附近有一个红叉,还有“?” 在“项目”栏下。
I can't understand why it's happening! It's really annoying, happened to me when I tried to add facebook API to my app, and I just gave up and copied the source to my project.
我不明白为什么会这样!这真的很烦人,当我尝试将 facebook API 添加到我的应用程序时发生在我身上,我只是放弃并将源代码复制到我的项目中。
Thanks, Elad!
谢谢,埃拉德!
回答by Rafael T
Copy every Library manually inside Eclipse Workspace, before importing it, as Eclipse seems to be silly if the Library lays somewhere else. Also symlinking a Library will not work.
在导入之前手动复制 Eclipse 工作区中的每个库,因为如果库位于其他地方,Eclipse 似乎很愚蠢。符号链接库也不起作用。
回答by Md Sufi Khan
For me, I just restart the eclipse and the added library works fine.
对我来说,我只是重新启动 eclipse 并且添加的库工作正常。
I mean first time it showing red marks after adding the library project. Though eclipse main project and library project are in same workspace folder and no resources files are in outside of the project folder.
我的意思是在添加库项目后第一次显示红色标记。尽管 eclipse 主项目和库项目位于同一个工作区文件夹中,并且项目文件夹之外没有资源文件。
So, you can try with to restart your eclipse. Happy coding....
因此,您可以尝试重新启动您的日食。快乐编码....