Using android swipelistview in project

2019-05-17 16:42发布

问题:

I'm having troubles configuring my gradle script so that I can use the swipelistview control. My script so far is

apply plugin: 'maven'

buildscript {
    repositories {
        maven { url 'http://clinker.47deg.com/nexus/content/groups/public' }
    }

    dependencies {
        compile 'com.fortysevendeg.swipelistview:swipelistview:1.0-SNAPSHOT@aar' {
            transitive = true
        }
    }
}



dependencies {
    compile files('libs/android-support-v4.jar')
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/osmdroid-android-4.0.jar')
    compile files('libs/slf4j-android-1.5.8.jar')
}


apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"
}

I haven't used gradle before so this script never worked as of yet, but I thought this would be a good time to start using it. Any help why this doesn't work? I found this in the swipelistview repo:

Gradle

repositories {
        maven { url 'http://clinker.47deg.com/nexus/content/groups/public' }
}

dependencies {
    compile ('com.fortysevendeg.swipelistview:swipelistview:1.0-SNAPSHOT@aar') {
        transitive = true
    }
}

But it doesn't work, i get this error message:

Could not find method com.fortysevendeg.swipelistview:swipelistview:1.0-SNAPSHOT@aar() for arguments [build_6ihucgurhldpf4gn6mjtnvcq7e$_run_closure1_closure3_closure5@57352cf2] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@510eb04b.

Even if this works, what does maven download, the source or the jar library?

回答1:

I think the sample code is kind of wired. I've make a version of my own. You can find it here