【问题标题】:Issue with adding Volley in Android Studio 3.1.2在 Android Studio 3.1.2 中添加 Volley 的问题
【发布时间】: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


【解决方案1】:

事实证明,Invalidate Caches / Restart 可以解决问题!

【讨论】:

    【解决方案2】:

    implementation 'com.android.volley:volley:1.1.1'替换它

    这肯定能解决问题。

    【讨论】:

      猜你喜欢
      • 2023-03-29
      • 2018-10-05
      • 2021-12-26
      • 2016-01-07
      • 1970-01-01
      • 2021-07-27
      • 2021-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多