Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apply plugin: 'android' or apply plugin: '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 ?

like image 254
Jacob Avatar asked Dec 07 '14 12:12

Jacob


People also ask

What is Android plugin application?

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.

Where do I put plugins in Android Studio?

Step 1: Open the Android Studio and go to File > Settings as shown in the below image. Step 2: After hitting on the Settings button a pop-up screen will arise like the following. Here select Plugins in the left panel.

What is apply plugin in Gradle?

Applying a plugin to a project allows the plugin to extend the project's capabilities. It can do things such as: Extend the Gradle model (e.g. add new DSL elements that can be configured) Configure the project according to conventions (e.g. add new tasks or configure sensible defaults)

Which are the two types of plugins in Gradle?

There are two types of plugins one is script plugin and second is binary plugin.


1 Answers

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 -

like image 183
Varundroid Avatar answered Sep 16 '22 17:09

Varundroid