Gradle找不到依赖

时间:2014-06-29 18:36:56

标签: android gradle android-studio

我在Android Studio 0.5.2中遇到gradle问题。

如下所示:

  

找不到com.android.support:support-v4:19.0.0。
            要求:
            org.codepond:wizardroid:1.2.0
            请从Android SDK Manager安装Android支持存储库。

我还安装了Android支持存储库。

我的build.gradle看起来像这样:

apply plugin: 'android-library'
apply plugin: 'android-maven'
apply plugin: 'signing'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19
        versionCode project.ext.versionCode
        versionName version
    }
}

dependencies {
    compile 'com.android.support:support-v4:19.0.0'
}

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
boolean hasCredentials = hasProperty('sonatypeUsername') && hasProperty('sonatypeUsername')

signing {
    required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
    sign configurations.archives
}

uploadArchives {
    configuration = configurations.archives

    repositories {
        mavenDeployer {
            beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

            repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
                if (hasCredentials) {
                    authentication(userName: sonatypeUsername, password: sonatypePassword)
                }
            }

            snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
                if (hasCredentials) {
                    authentication(userName: sonatypeUsername, password: sonatypePassword)
                }
            }

            pom.project {
                name 'WizarDroid'
                description 'Lightweight Android library for creating step by step wizards'
                url 'http://wizardroid.codepond.org'

                scm {
                    url 'http://www.github.com/nimrodda/wizardroid'
                    connection 'scm:git://github.com/Nimrodda/WizarDroid.git'
                    developerConnection 'scm:git://github.com/Nimrodda/WizarDroid.git'
                }

                licenses {
                    license {
                        name 'The MIT License (MIT)'
                        url 'https://raw.github.com/Nimrodda/WizarDroid/master/license'
                        distribution 'repo'
                    }
                }

                developers {
                    developer {
                        id 'nimrodda'
                        name 'Nimrod Dayan'
                        email 'feedback@codepond.org'
                    }
                }

                organization {
                    name 'CodePond.org'
                    url 'http://www.codepond.org'
                }

                issueManagement {
                    system 'GitHub Issues'
                    url 'https://github.com/nimrodda/wizardroid/issues'
                }

                parent {
                    groupId 'org.sonatype.oss'
                    artifactId 'oss-parent'
                    version 7
                }
            }
        }
    }
}

1 个答案:

答案 0 :(得分:0)

您应该将build.gradle更改为

dependencies {
    compile 'com.android.support:support-v4:19.1.+'
}