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

更新日期: 2018-12-21 阅读次数: 8792 分类: Android

在 Android Studio 上测试 Volley 发送 HTTP 请求时,编译报错

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

解决方法

将 app 下的 build.gradle 中的

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

替换为

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

测试环境

Android Studio 3.2.1

Build #AI-181.5540.7.32.5056338, built on October 9, 2018

JRE: 1.8.0_152-release-1136-b06 amd64

JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

Windows 10 10.0

爱评论不评论