简体   繁体   English

如何将ViewPagerIndicator添加到Android Studio

[英]How add ViewPagerIndicator to android studio

I see this link Using ViewPagerIndicator library with Android Studio and Gradle and here is my build.gradle 我看到此链接在Android Studio和Gradle中使用ViewPagerIndicator库,这是我的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"
    packagingOptions {
        exclude 'AndroidManifest.xml'
    }
    defaultConfig {
        applicationId "com.example"
        minSdkVersion 10
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    maven { url "http://dl.bintray.com/populov/maven" }
    mavenCentral()
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/nineoldandroids-2.4.0.jar')
    compile "com.android.support:appcompat-v7:18.0.+"
    compile('com.viewpagerindicator:library:2.4.1') {
        exclude module: 'support-v4'
    }

}

And gradle build has successfully completed .But i can't import com.viewpagerindicator.PageIndicator .I also check .gradle folder and viewpager folder already exist.Any ideas? gradle构建已成功完成。但是我无法导入com.viewpagerindicator.PageIndicator 。我还检查了.gradle文件夹和viewpager文件夹是否已经存在。

Use the full file path to the location of the jar. 使用完整文件路径到jar的位置。 That's worked for me every time. 每次都对我有用。 If you're using Android Studio make sure to 'Sync Project with Gradle Files' and rebuild as well. 如果您使用的是Android Studio,请确保“使用Gradle文件同步项目”并重新生成。

您是否通过文件->项目结构...->库(或模块)在Android Studio中添加了库?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM