1

I see this link Using ViewPagerIndicator library with Android Studio and Gradle and here is my 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?

Community
  • 1
  • 1
Saeed Masoumi
  • 8,746
  • 7
  • 57
  • 76

2 Answers2

0

Use the full file path to the location of the 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.

esme_louise
  • 540
  • 2
  • 9
  • 28
0

Did you add library in Android Studio by File -> Project structure... -> Libriaries (or Modules)?

Szymon Barylak
  • 92
  • 1
  • 2
  • 8