neobie
neobie

Reputation: 2910

ViewPagerIndicator

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?

Upvotes: 1

Views: 2008

Answers (4)

Mohamed
Mohamed

Reputation: 864

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()
    }
}

Upvotes: 1

Rizwan Sohaib
Rizwan Sohaib

Reputation: 1260

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..!!

Upvotes: 0

AllanT
AllanT

Reputation: 961

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.

Upvotes: 0

Abhijit
Abhijit

Reputation: 5083

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

Upvotes: 1

Related Questions