Add ViewPagerIndicator to Android Studio

前端 未结 5 963
余生分开走
余生分开走 2020-11-30 21:40

i\'m trying to get Jake Wharton\'s ViewPagerIndicator working with Android Studio but unfortunately it won\'t work.
I downloaded the .aar file from here and included it

5条回答
  •  萌比男神i
    2020-11-30 22:17

    It can be imported by Gradle like this:

    Top Level Build.gradle:

    buildscript {
        repositories {
            maven { url "http://dl.bintray.com/populov/maven" }
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.12.+'
        }
    }
    
    allprojects {
        repositories {
            maven { url "http://dl.bintray.com/populov/maven" }
            mavenCentral()
        }
    }
    

    In your App's build.gradle add this to your dependencies section:

    compile 'com.viewpagerindicator:library:2.4.1@aar'
    

    (Add @aar to avoid "packaging for apklib is not supported error")

    Works fine for me.

提交回复
热议问题