Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't apply the gradle 6.x plugin

It says I'm supposed to write:

plugins {
id "com.gradle.enterprise" version "3.5"
}

gradleEnterprise {
server = "https://gradle-enterprise.mycompany.com"
}

On the settings.gradle file according to: https://docs.gradle.com/enterprise/gradle-plugin/

But then I get an error saying:

2: Only Project build scripts can contain plugins {} blocks

like image 784
pete Avatar asked Nov 16 '20 21:11

pete


1 Answers

So I seem to have this working.

Please ensure plugins and and gradleEnterprise blocks are the first and second lines in the file respectively or you will get an error:

settings.gradle:

plugins {
    id 'com.gradle.enterprise' version '3.5'
}

gradleEnterprise {
    // configuration
}

include ':app'
rootProject.name = "My Application"

My Current Gradle plugin versions are as follows (FileProject Structure):

enter image description here

And it all builds fine.

PS: I was getting an error: This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.1 or newer. I had to update my android studios to the latest as well (4.1.1) and all worked a charm.

like image 200
David Kroukamp Avatar answered Oct 23 '22 11:10

David Kroukamp