【发布时间】:2018-05-01 12:38:36
【问题描述】:
我想将Volley 添加到我在 Android Studio 3.1.2 中的项目中。我正在尝试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
我在这里缺少什么?
【问题讨论】:
-
最好直接发布错误日志而不是图片。
-
@JayRathodRJ 你去。我想也许这样更容易找出问题所在。
-
您也可以发布应用程序 gradle (app.gradle) 吗?
-
@Wizard 感谢您的回复。使缓存无效/重启 Android Studio 成功了!
标签: android android-studio gradle android-volley