13

I'm creating a new app and I want to use some libraries like this: 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.

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.

Thanks, Elad!

Elad92
  • 2,471
  • 4
  • 22
  • 36
  • is the Library referenced by a SymLink? If, not is the Library inside your Eclipse_Workspace? – Rafael T Jan 22 '12 at 19:42
  • Sorry, I don't know what SymLink means, can you explain me? – Elad92 Jan 22 '12 at 19:45
  • if know You don't know we can assume you're not on a unix system. A SymLink is something like a Shortcut to a file. copy Your Libs inside Exlipse workspace and update to the latest SDK and ADT Tools – Rafael T Jan 22 '12 at 19:52
  • First try cleaning your project. Then try readding the library. It can be that eclipse is dirty – Adel Boutros Jan 22 '12 at 19:59
  • 2
    @RafaelT , I copied the library into the workspace and then create a new android project from it, but it didn't imported the source files and manifest so I just copied it inside the eclipse and overwrite and then tried to add it as a library and it worked! Thanks! Write it as an answer so I can confirm it. AdelBoutros many thanks to you to! – Elad92 Jan 22 '12 at 20:17

2 Answers2

25

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.

Rafael T
  • 15,401
  • 15
  • 83
  • 144
11

For me, I just restart the eclipse and the added library works fine.

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.

So, you can try with to restart your eclipse. Happy coding....

Md Sufi Khan
  • 1,751
  • 1
  • 14
  • 19