1

I try to use viewpagerindicator but somehow the Console error always show this:

E/AndroidRuntime(871): Caused by: java.lang.ClassNotFoundException: com.viewpagerindicator.TitlePageIndicator in loader dalvik.system.PathClassLoader

I have included the viewpagerindicator as library. Can anyone help pls?

neobie
  • 2,847
  • 5
  • 27
  • 31

4 Answers4

1

Try this: Right click on the project. Select Properties. Go to Java Build Path and make sure your library is checked. Once you ensure that it is checked, clean the project and then run your project. This should resolve your issue.

enter image description here

Abhijit
  • 4,853
  • 3
  • 30
  • 33
  • When I execute the project, the console log says: Could not find ViewPagerIndicator-Library.apk! – neobie May 26 '12 at 02:25
  • this occurs because the compilation time is the class at runtime but not, try adding the libraries to export as in the image above – ingyesid Nov 17 '12 at 02:19
1

Include it in the Gradle build files instead, there is 2 files :

build.gradle located in "app" folder and another located in the root project folder.

Update the "dependencies" section in the first one as follows :

dependencies {
   /..... other libs
   compile 'com.viewpagerindicator:library:2.4.1@aar'
   /.... other libs
}

And update the "allprojects" section in the second one as follows :

allprojects {
    repositories {
        maven { url "http://dl.bintray.com/populov/maven" }
        jcenter()
    }
}
Mohamed
  • 836
  • 1
  • 13
  • 23
0

I had lots of problems with viewpagerindicator until I switched my JDK over to the 32 bit version.

See https://stackoverflow.com/a/12831327/1116861 for more info.

Community
  • 1
  • 1
AllanT
  • 923
  • 11
  • 23
0

You must add libraries to the project.

First Do this;

File > Import > Android > Existing Android Code Into Workspace

Second Add Libraries into your project by;

Project Properties > Android > Scroll Down and Add required Libraries

-

I am not sure but This example may help you out; Making ActionBarSherlock and ViewPagerIndicator play nice

You may also come across a bug mentioned here; Android - SupportMapFragment with GoogleMaps API 2.0 giving IllegalArgumentException

Thats how I got my ViewPagerIndicator working..

Good Luck..!!

Community
  • 1
  • 1
Rizwan Sohaib
  • 1,240
  • 17
  • 27