AndroidStudio导入ViewPagerIndicator以及报错解决办法

AndroidStudio使用Build.gradle导入ViewPagerIndicator:

正常导入:

最外层的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()
    }
}

内部app的Build.gradle

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

报错:

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

解决办法,抱起上面正常导入的方式,重新用下面的方式导入:

最外层的Build.gradle

allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
    }

内部app的Build.gradle

ependencies {
            compile 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
    }


你可能感兴趣的:(【,Android,暂无分类,】)