Eclipse will not recognize project as library (ActionBarSherlock/ViewPagerIndicator)

TJ Biddle picture TJ Biddle · Apr 18, 2012 · Viewed 12k times · Source

I'm trying to get ActionBarSherlock and the ViewPagerIndicator libraries set up for my projects, but I seem to be running into a few issues. I sent Jake Wharton (The developer) a few messages earlier about it, and got a few replies but couldn't get anywhere - and I think he got busy with a few other things.

What my issue is, For both VPI and ABS For both VPI and ABS

Both libraries open up without any errors, and I'm using compiler version 1.6 for all as is required.

The funny thing is, if I load in the samples that are provided - they work fine and link to his library; but when I go to add the library to my project - the above happens.

Answer

yorkw picture yorkw · Apr 19, 2012

Where to store the actual library project does not matter, as long as you use a relative link to reference it. Check out the Library Projects - Development considerations:

  • Library project storage location

    There are no specific requirements on where you should store a library project, relative to a dependent application project, as long as the application project can reference the library project by a relative link. What is important is that the main project can reference the library project through a relative link.

You should always use the Eclipse ADT plugin to select and set up Library Project Reference, i.e. right-click project -> Properties -> Android -> Add, then in the opened Project Selection window, select the Library Project list here (of cause you should import them in the same Eclipse workspace as your Main Project). This will add a android.library.reference using relative path into project.properties as well as show relative path in the Android preference window:

android.library.reference.2=../../../../../Documents and Settings/yorkw/Desktop/JakeWharton-Android-ViewPagerIndicator-f09acb0/library

If you directly alter it using absolute path from project.properties as below:

android.library.reference.1=C:\\Documents and Settings\\yorkw\\Desktop\\JakeWharton-Android-ViewPagerIndicator-f09acb0\\library

Then after Eclipse refresh your project, you get the exact error described in your question, see my screenshot below: enter image description here

Hope this helps.