我想在Android Studio 3.1.2中为我的项目添加Volley
。我正在尝试使用implementation 'com.android.volley:volley:1.1.0'
。
这是项目的Gradle:
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
mavenCentral()
maven {
url "https://maven.google.com"
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
但它失败并出现以下错误:
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details
Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details
我在这里缺少什么?
答案 0 :(得分:0)
事实证明,Invalidate Caches / Restart
做了伎俩!
答案 1 :(得分:0)
将其替换为implementation 'com.android.volley:volley:1.1.1'
这肯定会解决问题。