Reputation: 330
Hi I have following android project:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
}
repositories {
mavenCentral()
}
android {
buildToolsVersion "17.0"
compileSdkVersion 17
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}
Now I would like to add another dependency: https://github.com/bauerca/drag-sort-listview. I tried adding
compile 'com.mobeta.android.dslv:drag-sort-listview:0.6.1-SNAPSHOT'
but it doesn't work. How can I add this project as a Gradle dependency? I saw that there is an option to copy this library as a subdirectory in my project dir. How should I include such a project?
Upvotes: 4
Views: 11179
Reputation: 3189
I like to recommend you to use this library instead.
I thinks https://github.com/ened is thanksfully made the library for gradle and maintained it for a while.
compile 'asia.ivity.android:drag-sort-listview:1.0'
<dependency>
<groupId>asia.ivity.android</groupId>
<artifactId>drag-sort-listview</artifactId>
<version>1.0</version>
</dependency>
http://mvnrepository.com/artifact/asia.ivity.android/drag-sort-listview/1.0
https://github.com/ened/drag-sort-listview
Upvotes: 1
Reputation: 22232
The author of the library has to upload @aar bundle to maven central repository to make it work. As you can see drag sort listview is no longer mainted by author. You can use repo from the community as temporal solution.
repositories {
mavenCentral()
maven {
url 'https://github.com/Goddchen/mvn-repo/raw/master/'
}
}
dependencies {
compile files('libs/android-support-v4.jar')
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.mobeta.android.dslv:drag-sort-listview:0.6.1'
}
In general case you have to download sources and add them as library to your project.
Upvotes: 5