Android 错误和警告:配置';编译';已过时,并已替换为';实施';和';api';。

Android 错误和警告:配置';编译';已过时,并已替换为';实施';和';api';。,android,android-studio,build,Android,Android Studio,Build,我在一个项目中工作,显然它抛出异常配置“compile”已经过时,并被“implementation”和“api”取代 这是我的应用程序build.gradle: apply plugin: 'com.android.application'android { compileSdkVersion 27 defaultConfig { applicationId "app.ayon.visiterbook" minSdkVersion 17 targetSdkVersion

我在一个项目中工作,显然它抛出异常配置“compile”已经过时,并被“implementation”和“api”取代

这是我的应用程序build.gradle:

apply plugin: 'com.android.application'android {
compileSdkVersion 27
defaultConfig {
    applicationId "app.ayon.visiterbook"
    minSdkVersion 17
    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 fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7: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'

compile 'com.android.volley:volley:1.0.0'
compile 'com.intuit.sdp:sdp-android:1.0.3'
compile 'de.hdodenhof:circleimageview:2.1.0'

implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'

compile 'com.sdsmdg.tastytoast:tastytoast:0.1.1'}
还有我的gradle文件:

buildscript 
{


这是一个警告,谷歌已经将
compile
改为
implementation
api
compile
将于2018年底删除

因此,只需将
编译
更改为
实现
即可

这个


build.gradle
文件中的
compile
更改为
implementation

设置
implementation
而不是
compile
如果要公开某些模块,请使用API
  repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}}allprojects {
repositories {
    google()
    jcenter()
}}task clean(type: Delete) {
delete rootProject.buildDir}
compile 'com.android.volley:volley:1.0.0'
compile 'com.intuit.sdp:sdp-android:1.0.3'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.sdsmdg.tastytoast:tastytoast:0.1.1'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.intuit.sdp:sdp-android:1.0.3'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.sdsmdg.tastytoast:tastytoast:0.1.1'