Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 490
Elad92 Avatar asked Jan 22 '12 19:01

Elad92


2 Answers

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.

like image 154
Rafael T Avatar answered Oct 22 '22 14:10

Rafael T


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

like image 27
Md Sufi Khan Avatar answered Oct 22 '22 13:10

Md Sufi Khan