Elad92
Elad92

Reputation: 2491

Can't add library to my android project

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!

Upvotes: 13

Views: 12265

Answers (2)

Md Sufi Khan
Md Sufi Khan

Reputation: 1761

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....

Upvotes: 11

Rafael T
Rafael T

Reputation: 15679

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.

Upvotes: 25

Related Questions