I for the life of me cannot get ViewPagerIndicator to compile for use in my project!
Website: http://viewpagerindicator.com/
Github: https://github.com/JakeWharton/Android-ViewPagerIndicator
Here are the steps I have taken:
-
Download Version 2.4.1 — 2012-09-11 from http://viewpagerindicator.com/.
(I have also tried cloning from the git repo) -
In Eclipse
File->Import->Existing Projects into Workspace. -
In the Import dialog, I browse to the Android-ViewPagerIndicator directory and import the example and library projects.
-
Eclipse then imports the projects and displays the following compile errors:
-
The container ‘Android Dependencies’ references non existing library ‘C:\Users\Jonathan\workspace\Android-ViewPagerIndicator\library\bin\library.jar’
-
error: Error: No resource found that matches the given name: attr ‘android:dividerPadding’.
-
dividerPadding cannot be resolved or is not a field
-
SHOW_DIVIDER_NONE cannot be resolved to a variable
-
error: Error: No resource found that matches the given name: attr ‘android:showDividers’.
-
SHOW_DIVIDER_MIDDLE cannot be resolved to a variable
-
The project cannot be built until build path errors are resolved
-
showDividers cannot be resolved or is not a field
-
My environment:
- Windows 7 SP 1
- Eclipse Platform 4.2.0.I20120608-1400 – org.eclipse.platform.ide
- Android 2.3.3 (API 10) Installed
- Android Support Library Installed
- Java v7.0.70.11
These errors seem stupid, why would basic constants and attributes be missing?
I’ve been Googling this damn thing for hours and can’t find anything, your help is MUCH appreciated!
The ViewPagerIndicator library requires being compiled with Android 4.0 or newer.
VPI uses constants which are only available on API 14 and newer which end up getting compiled into the class files directly. This is why despite using things from a new API you can still utilize the library back through Android 1.6.