7

I'm trying to include ViewPagerIndicator into my project and I'd rather use the Maven dependency rather than importing the android library project. There's some code posted for maven

<dependency>
  <groupId>com.viewpagerindicator</groupId>
  <artifactId>library</artifactId>
  <version>2.4.1</version>
  <type>apklib</type>
</dependency>

and inside the sample project, that code is in a pom.xml file, but I don't have that file. Can I translate the above code into my build.gradle file? Or can I just create a pom.xml file and put it in my project?

TMH
  • 6,096
  • 7
  • 51
  • 88
  • The answer is here: http://stackoverflow.com/questions/21130003/using-viewpagerindicator-library-with-android-studio-and-gradle – Ferran Maylinch Mar 19 '14 at 20:31

2 Answers2

3

You should ask the author JakeWharton to make an aar available on Maven Central. (vote here: https://github.com/JakeWharton/Android-ViewPagerIndicator/pull/229). Until then there is a temporary solution to use maven repo from community.

repositories {
    maven {
        url 'https://github.com/Goddchen/mvn-repo/raw/master/'
    }
    mavenCentral()
}

dependencies {
    compile 'com.actionbarsherlock:viewpagerindicator:2.4.1'
}

https://github.com/Goddchen/mvn-repo

Sergii Pechenizkyi
  • 22,227
  • 7
  • 60
  • 71
  • Sorry, the URL for the maven repository no longer works - check out this answer with the new repo http://stackoverflow.com/questions/21130003/using-viewpagerindicator-library-with-android-studio-and-gradle – jklp Jul 10 '14 at 06:39
  • 2
    Someone uploaded it to maven central directly. `compile 'com.mcxiaoke.viewpagerindicator:library:2.4.1'` – Sergii Pechenizkyi Jul 10 '14 at 07:39
0

You will find the file in Maven Central which means simple run the build and the file will be downloaded. This is also true for gradle where it looks like this:

'com.viewpagerindicator', name: 'library', version: '2.4.1', ext: 'apklib'
khmarbaise
  • 92,914
  • 28
  • 189
  • 235