I'm trying to import a library from github on my project ( link: https://github.com/justasm/DragLinearLayout )
However, importing on this way:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.jmedeisis:draglinearlayout:1.1.0'
compile 'com.android.support:appcompat-v7:23.0.0'
compile files('libs/.jar')
}
on my gadle file doesn't work ( error: Failed to resolve: com.jmedeisis:draglinearlayout:1.1.0
).
What are my solutions in this case? Is there a clean way to fix it or to import a github project otherwhise?
Gradle downloads binary from maven central repo by default not from github. And this package is not in maven central repo.
You can do those:
Add the following repository in your gradle file
repositories {
maven {
url "http://dl.bintray.com/elemyntic/android"
}
}
Following EROR's answer, I've succeed with something a bit easier by adding
allprojects { repositories { jcenter() } }
on my gradle file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.