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

在设置百分布局的时候,我们在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'
}

这个提示是gradle文件自上次更新后又发生了变化,需要再次同步,这里直接点Sync Now就好了

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