Search code examples
androidintellij-ideaactionbarsherlockviewpagerindicator

Compiling samples for ViewPagerIndicator with IntelliJ


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


Solution

  • 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