android - Gradle找不到依赖

标签 android gradle android-studio

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

如下图所示:

Could not find com.android.support:support-v4:19.0.0.
Required by:
org.codepond:wizardroid:1.2.0
Please install the Android Support Repository from the Android SDK Manager.



我还安装了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
                }
            }
        }
    }
}

最佳答案

您应该将build.gradle更改为

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

关于android - Gradle找不到依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24479031/

相关文章:

android - 如何让 Android BroadcastReceiver 抵抗意外停止?

java - 构建签名APK时android studio中的gradle问题

android - 使用 Gradle Kotlin-DSL 时如何使用 flavorDimensions 为每种 flavor 组合设置不同的 applicationId?

android - 我试图将我的 Android 应用程序连接到 google firebase,但它显示错误

android - 如何使具有服务器流连接的Android grpc客户端保持 Activity 状态?

android - 延迟任务并显示进度条

android - 替换默认的 Android Maps API v2 更改 MyLocation 图标

github - 如何使用 Saltslack 通过 Docker 设置 SonarQube,以及如何从 CI 中使用它

java - 如何修复 libgdx 项目上的此错误?

android - 如何在 Android Studio 3.5.2 中从 RecyclerView.ViewHolder(itemView) 获取 Activity?