在设置百分布局的时候,我们在build里面修改了一行代码
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
compile 'com.android.support:percent:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
然后会提示
Warning:Configuration 'compile' is obsolete and has been replaced with 'implementation'and'api'.
It will be removed at the end of 2018
意思就是
compile会被在2018年底取消,会被imlementation替代,所以会报这个警告,解决警告的方式就是换成imlementation就好了。
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:percent:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
然后再rebuild就好了
本文介绍如何在Gradle中将过时的'compile'配置替换为新的'implementation',以避免构建警告,并确保项目依赖项正确设置。
9109

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



