Gradle中的实现和编译之间有什么区别?

时间秒杀一切 提交于 2020-08-08 09:58:39

问题:

After updating to Android Studio 3.0 and creating a new project, I noticed that in build.gradle there is a new way to add new dependencies instead of compile there is implementation and instead of testCompile there is testImplementation . 在更新到Android Studio 3.0并创建一个新项目之后,我注意到在build.gradle有一种新的方法来添加新的依赖项而不是compile implementation而不是testCompiletestImplementation

Example: 例:

 implementation 'com.android.support:appcompat-v7:25.0.0'
 testImplementation 'junit:junit:4.12'

instead of 代替

 compile 'com.android.support:appcompat-v7:25.0.0'
 testCompile 'junit:junit:4.12'

What's the difference between them and what should I be using? 它们之间有什么区别,我应该使用什么?


解决方案:

参考一: https://stackoom.com/question/30gl8/Gradle中的实现和编译之间有什么区别
参考二: https://oldbug.net/q/30gl8/What-s-the-difference-between-implementation-and-compile-in-Gradle
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!