如何解决Android Studio警告错误? [复制]

问题描述 投票:0回答:2

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

警告:配置'compile'已过时,并已由'implementation'和'api'代替。它将在2018年底删除。有关更多信息,请参见:http://d.android.com/r/tools/update-dependency-configurations.html受影响的模块:应用]

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'


}

enter image description here

android android-gradle build.gradle
2个回答
1
投票

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


0
投票

这是您的代码警告。之所以显示该信息,是因为Google将在2019年之后删除'compile'支持。如果您正在使用它,则会警告您,请替换为'implementation'。因此,如果您不使用'compile',则无需担心此警告。

© www.soinside.com 2019 - 2024. All rights reserved.