Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
这是AndroidStudio3.0以后会出现的问题。
————————————————————————————————————————————————————
解决错误:
1.检查build.gradle下的配置,我们只需要修改depndencies,修改成我们Androidstudio对应的版本,如下:
dependencies { classpath 'com.android.tools.build:gradle:3.1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }
dependencies { classpath 'com.android.tools.build:gradle:3.1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }
dependencies { classpath 'com.android.tools.build:gradle:3.1.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } |
我安装的Androidstudio是3.0.1,因此我只需要改成:
}
dependencies { classpath 'com.android.tools.build:gradle:3.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } |
我们只需要注意我们下载的Androidstudio版本是多少,就改成对应的版本,如下图所示是我们选择下载Androidstudio版本的部分界面:
至此,这个问题就可以解决了,如果出现Configuration 'compile' is obsolete and has been replaced with 'implementation,我们只需把compile改成implementation即可。