【问题标题】:Error Configuration 'compile' is obsolete and has been replaced with 'implementation' and api错误配置“编译”已过时,已替换为“实现”和 api
【发布时间】:2018-11-24 10:01:42
【问题描述】:

最近我用构建工具和 api 更新了 android studio。

在同步当前项目时,我收到如下错误: “错误配置‘编译’已过时,已替换为‘实现’和‘API’。 如何解决此错误。

【问题讨论】:

    标签: android build android-studio-3.0


    【解决方案1】:

    我找到了针对此问题的完整解决方案。这是对 build.gradle 文件更改的简单说明。

    • 您必须将 compile 替换为 api 在您使用任何 api 引用的地方。喜欢:凌空、GitHub 依赖。强文本
    • 在您使用 android 库(如 play-services-maps、appcompat-v7 等)时,您必须将 compile 替换为 implementation

    ref

    【讨论】:

      【解决方案2】:

      compile 配置已弃用,因此您必须改用implementation 配置。在依赖项下,在您的应用模块的 build.gradle 中,将 compile 替换为 implementation

      【讨论】:

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