简体   繁体   中英

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

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 ):

在此处输入图片说明

And it all builds fine.

PS : I was getting an error: T his 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM