背景:不小心升级了AS的gradle导致cordova的android项目报错,第一步build都不通过
WARNING: Configuration'compile'is obsolete and has been replaced with'implementation'.It will be removed at the end of 2018
解决方法:
gradle降级
1.打开project structure

2.gradle plugin 和 gradle的版本对应

3.修改版本
改plugin版本为3.0.1,对应上面的图片得出gradle版本要在4.1+,上图对gradle只给了范围,具体版本号怎么填?
看这里:https://services.gradle.org/distributions/
找到

gradle版本填上4.1,点击确认键。
如图:

别忘了将app和project的build.gradle中的版本也改一下

点击build 成功
网友评论