1

How to import this dependency type into Android Studio?

Lib: https://github.com/JakeWharton/ViewPagerIndicator

<dependency>
  <groupId>com.viewpagerindicator</groupId>
  <artifactId>library</artifactId>
  <version>2.4.1</version>
  <type>apklib</type>
</dependency>
  • You could download the project from github and build it as a .jar file and then import it. Or you can use the following: https://github.com/MagicMicky/FreemiumLibrary/wiki/Import-the-library-in-Android-Studio – Fatmajk Apr 17 '18 at 13:47
  • 2
    Possible duplicate of [Using ViewPagerIndicator library with Android Studio and Gradle](https://stackoverflow.com/questions/21130003/using-viewpagerindicator-library-with-android-studio-and-gradle) – Michael Dodd Apr 17 '18 at 13:52
  • Are you really sure to use it? The last commit is 6 years ago. – ישו אוהב אותך Apr 17 '18 at 14:14

2 Answers2

1

It is available as a Gradle dependency from JitPack.

To add JitPack repository, add following in your root build.gradle file

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

Then add the dependency in module

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

For more information visit this.

Rahul Sahni
  • 465
  • 4
  • 12
  • getting exception as android.view.InflateException: Binary XML file line #346: Binary XML file line #346: Error inflating class com.viewpagerindicator.LinePageIndicator and error at setViewPager equired type: android.support.v4.view.ViewPager Provided: androidx.viewpager.widget.ViewPager – android dev Dec 16 '22 at 07:51
1

In AndroidStudio you can simply paste the above XML into your build.gradle dependency section and it will convert it to the gradle format as seen below.

compile 'com.viewpagerindicator:library:2.4.1' 

However if you are using the android gradle plugin 3.0+ you should change compile to implementation

Azzabi Haythem
  • 2,318
  • 7
  • 26
  • 32
cyroxis
  • 3,661
  • 22
  • 37
  • getting exception as android.view.InflateException: Binary XML file line #346: Binary XML file line #346: Error inflating class com.viewpagerindicator.LinePageIndicator and error at setViewPager equired type: android.support.v4.view.ViewPager Provided: androidx.viewpager.widget.ViewPager – android dev Dec 16 '22 at 07:52