更新了最新的依赖项:获取配置'编译'是过时的问题,无法与firebase连接[重复]

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

我用实现替换了编译,但我仍然遇到问题。我尝试了很多方法来解决这个问题,但我仍然没有得到。我在Gradle文件中没有遇到任何问题,但我只收到此警告“配置'编译'已经过时,已被'implementation'和'api'取代。” 。因此,我无法连接firebase(无法解析Android应用程序模块的Gradle配置).Below是我的成绩文件,

apply plugin: 'com.android.application'


 android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.test"
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
    exclude 'META-INF/mimetypes.default'
    exclude 'META-INF/gfprobe-provider.xml'
    exclude 'META-INF/javamail.default.address.map'
    exclude 'META-INF/mailcap.default'
    exclude 'META-INF/mailcap'
    exclude 'META-INF/javamail.charset.map'
    exclude 'META-INF/javamail.default.providers'
    exclude 'META-INF/hk2-locator/default'

   }
 }

dependencies {
ext {
    support_library_version = '28.0.0' //use the version of choice
}
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:${support_library_version}"
implementation "com.android.support:design:${support_library_version}"
implementation "com.android.support:cardview-v7:${support_library_version}"
implementation "com.android.support:support-annotations:${support_library_version}"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:asynclayoutinflater:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.0'
implementation 'commons-codec:commons-codec:20041127.091804'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.github.bumptech.glide:glide:4.0.0-RC0'
implementation 'me.dm7.barcodescanner:zxing:1.9.3'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-messaging:17.4.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.0'
implementation 'com.iceteck.silicompressorr:silicompressor:2.1'
implementation 'com.sun.mail:android-mail:1.5.6'
implementation 'com.sun.mail:android-activation:1.5.6'
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'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'realm-android'

项目级别Gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

 buildscript {
repositories {
    google()
    jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.3.1'
    classpath 'com.google.gms:google-services:4.0.1'
    classpath 'io.realm:realm-gradle-plugin:3.3.2'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    }
 }

 allprojects {
repositories {
    google()
    jcenter()
    mavenCentral()
    maven { url "https://jitpack.io" }
    }
  }

task clean(type: Delete) {
delete rootProject.buildDir
}
android android-gradle
1个回答
0
投票

你的一个图书馆仍在使用compile

例如这个库:implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.0'

在这个文件中:https://github.com/chthai64/SwipeRevealLayout/blob/master/swipe-reveal-layout/build.gradle

使用:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:24.2.0'
}
© www.soinside.com 2019 - 2024. All rights reserved.