【问题标题】:Failed to resolve: com.android.volley:volley:1.0.1无法解决:com.android.volley:volley:1.0.1
【发布时间】:2018-09-10 04:45:27
【问题描述】:

我刚刚在依赖列表中添加了implementation 'com.android.volley:volley:1.0.1' 并得到了异常。我错过了什么吗?

无法解析:com.android.volley:volley:1.0.1

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.pankajgarg.practise"
        minSdkVersion 14
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.android.volley:volley:1.0.1'
}

我也尝试过 volley 1.0.0 版,但同样的问题

build.grade

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

【问题讨论】:

标签: android-studio


【解决方案1】:

确保您有互联网连接并重建您的项目,以便 Android Studio 可以下载库

【讨论】:

    【解决方案2】:

    根据 repo com.android.volley:volley:1.0.1,此版本不可用。所以你需要从

    implementation 'com.android.volley:volley:1.0.1'
    

    implementation 'com.android.volley:volley:1.1.0'
    

    您可以查看此存储库链接以查看所有可用版本的 Volley here

    GitHub 存储库 here 和开发者文档以获取更多帮助 here

    希望对你有帮助

    【讨论】:

    • 还有问题吗?请refer
    【解决方案3】:

    对于那些尝试了互联网上所有可能的解决方案但仍然无法解决问题的人... 对我有用的是首先通过从 build.gradle(Project) 中的 buildscript 存储库中删除 jcenter() 来同步 gradle 文件,然后在将 jcenter() 放入 build.gradle(Project) 中的 buildscript 存储库后再次同步。

    【讨论】:

      猜你喜欢
      • 2018-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多