Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add github library as dependency to Android-Studio project

People also ask

How do I add a library project to Android Studio?

Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Library Dependency in the dropdown. In the Add Library Dependency dialog, use the search box to find the library to add.


It will work when you put this line in your project build.gradle, in the dependencies section:

compile 'com.github.chrisbanes.actionbarpulltorefresh:extra-abc:+'

Also, add:

repositories {
    mavenCentral()
}

So:

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.android.support:support-v4:18.0.+'
    compile 'com.android.support:appcompat-v7:18.0.+'
    compile 'com.github.chrisbanes.actionbarpulltorefresh:extra-abc:+'
}

Gradle will download the needed resources automatically for you.


Use https://jitpack.io/

allprojects {
    repositories { 
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
dependencies {
    compile 'com.github.User:Repo:Tag'
}