Gradle构建失败(Volley)

时间:2018-05-02 07:25:32

标签: android android-studio build android-gradle

每当我添加编译齐射线时,它都不会构建。它一旦删除就有效。我检查了它的最后一个版本。他们说它会自动下载软件包。我阅读了所有相关的主题,但没有解决。

 apply plugin: 'com.android.application'

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

dependencies {

    compile 'me.dm7.barcodescanner:zxing:1.9'
    compile 'com.android.volley:volley:1.1.0'

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.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'

}

错误:

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.

1 个答案:

答案 0 :(得分:0)

您可能还需要将jcenter添加到项目build.gradle文件中:

repositories {
    jcenter()
}