如何解决 Android Studio 警告错误?

How to solve Android Studio warning Error?

当我构建我的 android 工作室项目时,它显示一条消息

警告:配置 'compile' 已过时,已替换为 'implementation' 和 'api'。 它将在 2018 年底删除。有关详细信息,请参阅:http://d.android.com/r/tools/update-dependency-configurations.html 受影响的模块:app

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    testImplementation 'junit:junit:4.12'
    implementation files('libs/CircleImageView-master/gradle/wrapper/gradle-wrapper.jar')
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation  'com.google.android.gms:play-services-auth:11.8.0'
    implementation 'com.android.support:cardview-v7:27.1.1'


}

build.gradle(应用级别)中, 将 compile 替换为 implementation

如果您正在使用 implementation 则不必担心该警告。

这是您的代码警告。它显示是因为 google 将在 2019 年后删除 'compile' 支持。如果您正在使用它,它会给您警告,请将其替换为 'implementation'。所以如果你没有使用 'compile' 那么你不需要担心这个警告。