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

又搞定一个难题,好开心~

android百分比布局是要配置percent依赖的,按某些教材这样写:

compile 'com.android.support:percent:28.0.0'

版本和自己的sdkToll一个版本,如果低于这个版本会有警告!

而现在最新版的android studio已经不是compile的写法了,而是implement,所以说:

只要把compile改为implement就行了,我的改了之后正确结果是:

implementation 'com.android.support:percent:28.0.0'

点一下右上角大象标志sync一下就没有报错了。

这个问题我也是找了很久的方法,一开始是到本地support目录找percent各个版本,我最高是26.0.0-,但是还是比28小,因为compile的原因怎么弄都不成功,警告就是标题栏写的内容。刚好今晚看到代码书上又是需要配置新的依赖,不知怎的想到换成implement试试,结果就真的没问题了,开心开心,记录一下~

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'._第1张图片

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'._第2张图片

你可能感兴趣的:(WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.)