错误配置“编译"已过时,并已由“实现"和api取代 [英] Error Configuration 'compile' is obsolete and has been replaced with 'implementation' and api

查看:70
本文介绍了错误配置“编译"已过时,并已由“实现"和api取代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我已使用构建工具和API更新了android studio.

Recently I Have updated android studio with build tools and apis.

在同步当前项目时,出现如下错误:错误配置'compile'已过时,并已由'implementation和'api'代替.如何解决此错误.

While syncing current project i am getting error like: "Error Configuration 'compile' is obsolete and has been replaced with 'implementation and 'api'. how to fix this error.

推荐答案

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

I found a Complete solution for this issue. here is a simple explanation for changes in you build.gradle file.

  • 无论您使用任何API引用,都必须用 api 替换 compile .像:凌空抽空,GitHub依赖.强文本
  • 在使用android库(例如play-services-maps,appcompat-v7等)的任何地方,您都必须用实现替换 compile .
  • You have to replace compile with api where ever you are using any api ref. like: volley, GitHub dependancy.strong text
  • You have to replace compile with implementation where ever you are using android library like play-services-maps,appcompat-v7 etc

ref

这篇关于错误配置“编译"已过时,并已由“实现"和api取代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆