Blaze Tama
Blaze Tama

Reputation: 10948

Android add library in gradle

Note : My project is eclipse, migrated to android studio with gradle

I tried to use this library, i add the following code like they suggested in the link :

repositories {
        jcenter()
    }

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':Library-PullToRefresh')
    compile project(':google-play-services_lib')
    compile project(':Library-UniversalImageLoader')
    compile 'com.android.support:support-v4:19.0.+'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.android.support:cardview-v7:22.0.0'
    compile 'com.android.support:recyclerview-v7:22.0.0'
    compile 'com.marshalchen.ultimaterecyclerview:library:0.3.17' //here
}

After that, i tried to sync the gradle. It takes almost 30 minutes and finally gave me an error :

unable to resolve com.marshalchen.ultimaterecyclerview:library:0.3.17

What should i do?

This is the rest of my gradle file, its a standard one :

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

Thanks for your time.

Upvotes: 2

Views: 278

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 364451

This artifact doesn't exist in jcenter.

com.marshalchen.ultimaterecyclerview

You can check in : https://bintray.com/bintray/jcenter

You can try to use the maven central instead of jcenter.

repositories {
        mavenCentral()
}

dependencies{
   compile 'com.marshalchen.ultimaterecyclerview:library:0.3.11
}

You can check the versions published here.

Upvotes: 4

Related Questions