apply plugin: 'android' or apply plugin: 'com.android.application'

匿名 (未验证) 提交于 2019-12-03 01:18:02

问题:

As in topic. Gradle require to set up plugin and there are times that it is mentioned to apply plugin: 'android', and other to apply plugin: 'com.android.application' .

What are the differenceres? Which one should be used ?

回答1:

apply plugin: 'android' specifies that It's an Android project but it does not specify Its an Application or Library project. To make life easier you can tell gradle the type of project and indicate which plugin should be used. I recommend to use apply plugin: 'com.android.application if project is an app and apply plugin: 'com.android.library' if project is a lib. It helps gradle to compile project efficiently.

Click here for detailed explanation -



回答2:

Which one should be used ?

apply plugin: 'com.android.application' 

What are the differenceres?

They renamed the plugin to comply with the naming convention that Gradle is starting to adopt for plugins, with an eye towards a new plugin system in future versions of Gradle.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!