【发布时间】:2018-07-05 20:43:33
【问题描述】:
在我成功更新到 Android Studio 3.1 Canary 9 后,我收到警告消息
Warning:Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018
我知道这个警告至少目前不会在我的项目中造成任何问题。但是我想完全删除它,以便将来完全没有问题。但是在查看了我的 build.gradle 文件后,我根本找不到任何调用此警告的代码行。
这是我的 build.gradle 文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "app.project.virtualdiary"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.android.support:support-vector-drawable:27.0.2'
}
apply plugin: 'com.google.gms.google-services'
【问题讨论】:
-
可能子项目或依赖项使用的是编译而不是实现
-
那么显示这个不是很麻烦吗?:)
-
[stackoverflow.com/a/49574725/7457272][1] 使用新依赖升级 kotlin 的版本,请按照上面的链接。这可能对你有用:)
-
这是一个完整的分步解决方案:https://stackoverflow.com/a/49892731/4648533
标签: android android-studio android-gradle-plugin