应用插件:'android' 或应用插件:'com.android.application' [英] apply plugin: 'android' or apply plugin: 'com.android.application'

查看:50
本文介绍了应用插件:'android' 或应用插件:'com.android.application'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如主题.Gradle 需要设置 plugin 并且有时会提到 apply plugin: 'android' 和其他apply插件:'com.android.application'.

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 ?

推荐答案

apply plugin: 'android' 指定它是一个 Android 项目,但没有指定它是一个应用程序或库项目.为了让生活更轻松,您可以告诉 gradle 项目类型并指明应该使用哪个插件.我建议使用 apply plugin: 'com.android.application 如果项目是一个应用程序和 apply plugin: 'com.android.library' 如果项目是一个库.它有助于 gradle 高效地编译项目.

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.

点击这里详细解释 -

这篇关于应用插件:'android' 或应用插件:'com.android.application'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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