2

I am trying to build the samples for the ViewPagerIndicator using IntelliJ.

The current errors I am getting are like this (I get a bunch of those):

[Sample] ~/projects/ViewPagerIndicator-2.4.1-0/sample/res/values/styles.xml:19: error: Error: No resource found that matches the given name: attr 'vpiCirclePageIndicatorStyle'.

What I have done so far:

  1. I created a new project using existing sources for samples
  2. Then I went in the project structure, added new modules from existing sources for both ActionBarSherlock and for ViewPagerIndicator browsing to the "library" folders
  3. List item
  4. I made the ActionBarSherlock module to be a dependency for ViewPagerIndicator
  5. I made both the ActionBarSherlock module and the ViewPagerIndicator one to be dependencies for the "samples" module

All of them are using Android 4.1 Platform SDK. I did not make any changes to the source code.

EDIT: As requested, styles.xml and AndroidManifest.xml for the samples is posted here: http://pastebin.com/YQxYy3md

Again, I did not make any modifications, the original source code is accessible on the website for ViewPagerIndicator

Matthieu
  • 16,103
  • 10
  • 59
  • 86

3 Answers3

2

Actually found the solution in another question: https://stackoverflow.com/a/10627940/347565

What I was missing was to check the "Is a library project" in the Project Structure... -> Modules -> ViewPagerIndicator -> Android

I guess that's the part that allows projects depending on that library to use the resources and attributes...

EDIT: To make sure I capture all the details, the dependencies are setup like this:

  • ActionBarSherlock depends on android-support-v4.jar (and this one is setup as Export)
  • ViewPagerIndicator depends on ActionBarSherlock
  • Samples (for ViewPagerIndicator) depend on both ActionBarSherlock and ViewPagerIndicator
Community
  • 1
  • 1
Matthieu
  • 16,103
  • 10
  • 59
  • 86
1

Copy any resource:

/library/src/com/viewpagerindicator in to /sample/src/com/viewpagerindicator

/library/res/color in to /sample/res/

/library/res/drawable/vpi__tab_indicator.xml in to /sample/res/drawable/

/library/res/drawable-hdpi in to /sample/res/drawable-hdpi

/library/res/values/ in to /sample/res/values

I use this source code

Sardor Dushamov
  • 1,665
  • 3
  • 17
  • 44
  • Trying now... but wouldn't that defeat the purpose of using it as a library? – Matthieu Oct 09 '12 at 08:48
  • 1
    Thanks for the help. I think that would work. I posted what (I think) the right way is to still be using it as an external library / dependency (would make it easier to upgrade when new versions are available and so on. – Matthieu Oct 09 '12 at 09:12
0

Also import the library project that comes along with the sample project. It will fix it

DK250
  • 1,064
  • 13
  • 11