【问题标题】:Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018 [duplicate]配置“编译”已过时,已替换为“实现”和“API”。它将在2018年底被删除[重复]
【发布时间】:2018-10-28 15:26:03
【问题描述】:

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

这是我的 build.gradle(Module: app):

apply plugin: 'com.android.application'
android {
    compileSdkVersion 26
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "ir.chistaapplication.www.myapplication20"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        dependencies {
            compile 'com.android.support:appcompat-v7:26.1.0'
        }
    }
}

【问题讨论】:

  • 如果您要将某些内容标记为重复,请在您的评论中添加指向原始问题的链接。谢谢

标签: java android gradle android-gradle-plugin


【解决方案1】:

用这样的实现替换编译

dependencies {
            implementation 'com.android.support:appcompat-v7:26.1.0'
        }

【讨论】:

    猜你喜欢
    • 2018-09-17
    • 1970-01-01
    • 1970-01-01
    • 2018-11-24
    • 1970-01-01
    • 2019-08-19
    • 2019-12-06
    • 2019-11-03
    • 1970-01-01
    相关资源
    最近更新 更多