警告是这样的:
**Warning:Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’.It will be removed at the end of 2018**
讲的是 :
**警告:配置' compile '已过时,已被' implementation '取代。将在2018年***去除掉这个**
解决办法:
例如我们以前的代码是这样的:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-core-ui:25.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}
改写后的代码:
dependencies {
implementati

这篇博客警告Android开发者,'compile'配置已过时,应改为'implementation'。2018年底将彻底移除'compile'。解决方案是将项目中所有'compile'替换为'implementation',同样适用于androidTestCompile和testCompile。尽管两者在用处上相似,但'implementation'不会传递依赖,从而缩短编译时间。
最低0.47元/天 解锁文章
9127

被折叠的 条评论
为什么被折叠?



