在依赖项中添加Volley

时间:2018-09-24 14:52:42

标签: android android-studio

我正在尝试在build.gradle中添加Volley(模块:应用程序):

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    compile 'com.android.volley:volley:1.1.1'
}

并出现以下错误:

Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.

出什么问题了?以及我该如何解决?

1 个答案:

答案 0 :(得分:1)

尝试一下

implementation 'com.android.volley:volley:1.1.1'

代替

compile 'com.android.volley:volley:1.1.1'
相关问题