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

本文介绍如何解决Android Studio 3.0及之后版本中出现的关于依赖配置的警告信息,包括将'compile'更改为'implementation'的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html


这是AndroidStudio3.0以后会出现的问题。

————————————————————————————————————————————————————


解决错误:


1.检查build.gradle下的配置,我们只需要修改depndencies,修改成我们Androidstudio对应的版本,如下:

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
 dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }


我安装的Androidstudio是3.0.1,因此我只需要改成:


}
 dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }


我们只需要注意我们下载的Androidstudio版本是多少,就改成对应的版本,如下图所示是我们选择下载Androidstudio版本的部分界面:




至此,这个问题就可以解决了,如果出现Configuration 'compile' is obsolete and has been replaced with 'implementation,我们只需把compile改成implementation即可。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值