首页 > 解决方案 > 如何清除以下代码的错误?

问题描述

我在将我的应用程序同步到 Firebase 时收到警告消息。警告消息是=>“配置'编译'已过时,已被'实现'和'api'取代。”我不知道如何纠正它。有人帮我解决这个错误

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.selvakumar.firebase"
        minSdkVersion 15
        targetSdkVersion 28
        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:28.0.0-rc01'//i got error in this line
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    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.google.firebase:firebase-core:16.0.0'
}
apply plugin: 'com.google.gms.google-services'

标签: android-studio

解决方案


compile 在所有库之前从 android studio 3.1 使用实现中被弃用

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:28.0.0-beta01'
implementation 'com.android.support:recyclerview-v7:28.0.0-beta01'
implementation 'com.android.support:cardview-v7:28.0.0-beta01'
implementation 'com.android.support:support-v4:28.0.0-beta01'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.blankj:utilcode:1.12.5'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.google.firebase:firebase-crash:11.4.2'
implementation 'com.google.firebase:firebase-core:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
implementation 'com.google.firebase:firebase-perf:11.4.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.dagger:dagger:2.13'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.github.pchmn:MaterialChipsInput:1.0.8'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
implementation 'com.daimajia.easing:library:2.0@aar'
implementation 'com.daimajia.androidanimations:library:2.3@aar'
implementation 'com.github.jkwiecien:EasyImage:2.0.4'
implementation 'com.droidninja:filepicker:2.1.5'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.airbnb.android:lottie:2.2.5'
implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'com.github.mrengineer13:snackbar:1.2.0'
implementation 'agency.tango.android:material-intro-screen:0.0.5'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') { transitive = true }
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.github.sharish:ShimmerRecyclerView:v1.2'
implementation 'com.github.samanzamani.persiandate:PersianDate:0.3'
implementation 'com.stephentuso:welcome:1.4.1'
implementation 'com.yanzhenjie:permission:2.0.0-rc6'
implementation 'com.github.skydoves:powermenu:2.0.4'
implementation 'com.android.support:multidex:1.0.3'
implementation 'lib.kingja.switchbutton:switchbutton:1.1.7'
implementation 'com.github.pinball83:masked-edittext:1.0.4'

推荐阅读