安卓 android studio 报错 WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and

时间:2024-05-01 12:53:03

报错截图:

安卓 android studio 报错 WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and

问题原因:compile会被在2018年底取消,会被imlementation替代,所以会报这个警告,解决警告的方式就是换成 imlementation 就好了

解决方法:

在 app 的 Gradle 中:

compile  改为  implementation
androidTestCompile 改为 androidTestImplementation
testCompile 改为 testImplementation

这样替换了过时的,再重新编译即可。