17

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.

Marek Sebera
  • 39,650
  • 37
  • 158
  • 244
TJ Biddle
  • 6,024
  • 6
  • 40
  • 47
  • I ran into the same problem too, for my case I copied classes that i need to use only. – NyanLH Apr 18 '12 at 01:47
  • @NyanLH - What exactly do you mean? Right now I'm doing Right Click Project > Properties > Android > Add Library - And then I get the red X next to it. How exactly do I go about with your solution? – TJ Biddle Apr 18 '12 at 02:37
  • There's not really enough information to go on. More details about exactly what you've done would probably help. – E-Riz Apr 18 '12 at 02:59
  • Done everything pretty much textbook on the installation. I added the ABS and VPI libraries and marked them as "Is a library" in the Android Preferences - then went to go add them as a library to my project, and it pops up with a red X like in the picture. The Sample Applications that the libraries come with work perfectly fine, and when i check their libraries they're referencing the same location (Except in this case, '..\' since that's where it is relative to it's folder) Really weird =\ – TJ Biddle Apr 18 '12 at 03:18

3 Answers3

25

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.

yorkw
  • 40,926
  • 10
  • 117
  • 130
  • Yup, this was basically it. I checked a few other questions and found out it needed to be a relative path; for some reason my latest project decided it wanted to save itself in a different folder from my other projects - so it was using an absolute path as opposed to relative. Thanks! – TJ Biddle Apr 19 '12 at 02:18
  • Thanks. In my case, I forgot that my project was imported from git and was physically located in another folder than all other projects. – kolobok Mar 09 '13 at 10:45
  • 1
    I just have to use the relative path. it is not necessary in the same workspace folder. but have to on the same drive. is it a bug? – temple May 09 '14 at 19:29
3

While importing the libraries, make sure that you tick the "Copy projects int workspace" check box. The library projects need to be in the same workspace for them to work.

Rajesh
  • 15,724
  • 7
  • 46
  • 95
0

delete and import the project and lib again. build the lib project , add lib to project, still error shows.. rename the lib project. this worked for me ....

Sandeep P
  • 4,291
  • 2
  • 26
  • 45
  • restart eclipse worked for me too..(I had actionbarsherlock imported, reimported, imported from another location.. nothing worked, still showed "X") – Radu Toader Jan 26 '15 at 09:23