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' 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.
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.
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)
There are two types of plugins one is script plugin and second is binary plugin.
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 -
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With