【问题标题】:Odd error Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'奇怪的错误配置“编译”已过时并已替换为“实现”和“API”
【发布时间】:2018-10-30 13:57:15
【问题描述】:

奇怪的错误配置“编译”已过时,已被“实现”和“API”替换

配置“编译”已过时,已替换为“实施”和“API”。 将于 2018 年底移除。更多信息请参阅:http://d.android.com/r/tools/update-dependency-configurations.html

当我将所有“编译”转换为“实现”时

apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {
    compileSdkVersion 27
    buildToolsVersion "28.0.2"
    defaultConfig {
        applicationId "yts.mnf.torrent"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 12
        versionName "1.5"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation files('libs/gson-2.8.0.jar')
 //   implementation files('libs/StartAppInApp-3.5.7.jar')
    // Mandatory
    // Mandatory

    implementation 'com.tapadoo.android:alerter:3.0.0'
    implementation 'com.github.coyarzun89:fabtransitionactivity:0.2.0'
    implementation 'com.github.clans:fab:1.6.4'
    implementation 'com.google.android.gms:play-services-basement:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.google.firebase:firebase-messaging:17.3.0'
    implementation 'com.google.firebase:firebase-core:16.0.3'
    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
    implementation 'com.github.dimorinny:floating-text-button:0.0.4'
    implementation 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.github.developer-shivam:crescento:1.2.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.jakewharton:butterknife:8.8.1'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.robertlevonyan.view:MaterialChipView:1.2.4'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.android.support:palette-v7:27.1.1'
    implementation 'com.github.Cutta:TagView:1.3'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.github.castorflex.smoothprogressbar:library-circular:1.3.0'
    implementation 'com.ruslankishai:unmaterialtabs:0.1a'
    implementation 'com.android.support:support-vector-drawable:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    testImplementation 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'com.google.gms.google-services'

【问题讨论】:

  • 你的谷歌服务插件版本是什么
  • 如果我记得很清楚,那是因为项目build.gradle 文件中的 gradle 版本。在dependencies{}下搜索classpath
  • 你可能也在使用旧版本的 Realm

标签: android


【解决方案1】:

这意味着您的至少一个库当前在其build.gradle 中使用compile 语法。除了打开相关项目的问题(如果存在)之外,您对此无能为力。如果您使用的是废弃的项目,那么您需要将它们分叉并实现您自己的版本(Jitpack 是一项允许您在 Github 上实现任何 Gradle 项目的服务)。

另外,对于 Gson,您可以并且应该使用正常的实现:

implementation 'com.google.code.gson:gson:2.8.5'

不需要 JAR。


这是您拥有的正在使用 compile 的库的列表:

  • com.github.coyarzun89:fabtransitionactivity
  • com.github.clans:fab
  • com.ogaclejapan.smarttablayout:图书馆
  • com.github.developer-shivam:crescento
  • com.robertlevonyan.view:MaterialChipView
  • com.github.Cutta:TagView
  • com.ruslankishai:unmaterialtabs(这个已完全弃用)

您的许多其他依赖项也已经过时了。如果依赖项以黄色突出显示,请单击它,按 Alt+Enter 并选择建议的修复以更新依赖项版本。

这对于任何 Firebase 或 Google 实施都特别重要!

【讨论】:

    【解决方案2】:

    您只需要在应用程序级别的 build.gradle 中更新您的领域类路径 到可用here的最新版本领域,您的警告将得到解决

    【讨论】:

      猜你喜欢
      • 2018-11-24
      • 1970-01-01
      • 2019-08-19
      • 2019-11-03
      • 1970-01-01
      • 2018-07-15
      • 2019-01-13
      • 2018-07-20
      • 2018-11-30
      相关资源
      最近更新 更多