I want to use gradle plugin having this syntax
plugins { id "id" version "version" }
but i have the error of
only build script and other plugins script blocks are allowed before plugins
I moved it to the bloc buildscript but still not working.
How can i apply this kind of plugin ?
This is the plugin that I want to include in my project
gradle git properties plugin
and here is the output of my gradle version
Gradle 4.3.1 ------------------------------------------------------------ Build time: 2017-11-08 08:59:45 UTC Revision: e4f4804807ef7c2829da51877861ff06e07e006d Groovy: 2.4.12
There are two general types of plugins in Gradle, binary plugins and script plugins.
The Android Gradle plugin (AGP) is the official build system for Android applications. It includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.
The buildScript block determines which plugins, task classes, and other classes are available for use in the rest of the build script. Without a buildScript block, you can use everything that ships with Gradle out-of-the-box.
To do that, just pick the Gradle Remote Debug configuration and then click the Debug icon on the project to be debugged. For more info, you can read the Gradle documentation. Follow us for more productivity tools & ideas for Android, Kotlin & Gradle projects.
Whenever you write a build.gradle
script and use the new plugins
script block, you need to put it as first block in the file. The only exceptions from this rule are other plugins
blocks or the special buildScript
block, which always must go first.
As an example, this script is fine:
plugins { // ... } dependencies { // ... }
This one is also fine:
buildScript { // ... } plugins { // ... } repositories { // ... }
But this one is invalid:
repositories { // ... } plugins { // ... }
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