Home > Enterprise >  Could not find method buildscripts() for arguments
Could not find method buildscripts() for arguments

Time:05-01

// Top-level build file where you can add configuration options common to all sub-projects/modules.

plugins {
    id 'com.android.application' version '7.1.2' apply false
    id 'com.android.library' version '7.1.2' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

buildscripts {
    repositories {
        google()
    }
    dependancies {
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

allprojects {
    repositories {
        google()
    }
}

The above code is my project level gradle.build file. The error that keeps occurring is that it is not able to find a method known as buildscripts(). I have very little experience with gradle and have almost 0 idea what I could even try.

CodePudding user response:

In your Gradle file, all buildscript {} blocks must appear before any plugins {} blocks in the script. So your file should look like this:

buildscripts { //           
  • Related