# Got an error plugin was not found

**URL:** https://discuss.gradle.org/t/got-an-error-plugin-was-not-found/46974
**Category:** Help/Discuss
**Created:** [November 13, 2023, 6:15am UTC](https://discuss.gradle.org/t/got-an-error-plugin-was-not-found/46974 "2023-11-13T06:15:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![GarudPilani](https://avatars.discourse-cdn.com/v4/letter/g/ea5d25/32.png) [@GarudPilani](https://discuss.gradle.org/u/GarudPilani)
#### Post date: [November 13, 2023, 6:15am UTC](https://discuss.gradle.org/t/got-an-error-plugin-was-not-found/46974/1 "2023-11-13T06:15:47Z")

</div>

my android level gradle file is as follows

```gradle
buildscript {
    ext.kotlin_version = '1.7.10'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.4.0'
    }
}

plugins {
    // ...

    // Add the dependency for the Google services Gradle plugin
    id 'com.google.gms.google-services' version '4.4.0' apply false

}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

```

my app level gradle file is as follows

```gradle
plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
    id 'com.google.gms.google-services'
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

android {
    namespace "com.task1sutt.task_1_sutt"
    compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.task1sutt.task_1_sutt"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    // Import the Firebase BoM
    implementation platform('com.google.firebase:firebase-bom:32.5.0')

    // TODO: Add the dependencies for Firebase products you want to use
    // When using the BoM, don't specify versions in Firebase dependencies
    implementation 'com.google.firebase:firebase-analytics'

    // Add the dependencies for any other desired Firebase products
    // https://firebase.google.com/docs/android/setup#available-libraries

    // Add the dependency for the Firebase Authentication library
    // When using the BoM, you don't specify versions in Firebase library dependencies
// implementation("com.google.firebase:firebase-auth")
//
// // Also add the dependency for the Google Play services library and specify its version
// implementation("com.google.android.gms:play-services-auth")
}

```

```gradle
Plugin [id: 'com.google.gms.google-services', version: '4.4.0', apply: false] was not found in any of the following sources:

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

```

---

<div class="post-metadata">

### Author: ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)
#### Post date: [November 13, 2023, 10:04am UTC](https://discuss.gradle.org/t/got-an-error-plugin-was-not-found/46974/2 "2023-11-13T10:04:17Z")

</div>

As you cut part of the error message, I can only guess, but you probably did not add `google()` as plugin repository in your settings script and due to that the `id 'com.google.gms.google-services' version '4.4.0' apply false` cannot be resolved. But actually, it is not necessary anyway, as you already use the legacy discouraged way to add it to the buildscript classpath using `classpath 'com.google.gms:google-services:4.4.0'`, so you could just remove that line.

---

<div class="post-metadata">

### Author: ![Karthikstrom](https://avatars.discourse-cdn.com/v4/letter/k/f17d59/32.png) [@Karthikstrom](https://discuss.gradle.org/u/Karthikstrom)
#### Post date: [March 30, 2024, 10:28am UTC](https://discuss.gradle.org/t/got-an-error-plugin-was-not-found/46974/3 "2024-03-30T10:28:47Z")

</div>

@GarudPilani Did you find the solution? I am troubleshooting the same issue. I also tried what Bjorn suggested but did not work for me

---

<div class="post-metadata">

### Author: ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)
#### Post date: [March 30, 2024, 11:02am UTC](https://discuss.gradle.org/t/got-an-error-plugin-was-not-found/46974/4 "2024-03-30T11:02:16Z")

</div>

Can you share your exact error message?

---

<div class="post-metadata">

### Author: ![Karthikstrom](https://avatars.discourse-cdn.com/v4/letter/k/f17d59/32.png) [@Karthikstrom](https://discuss.gradle.org/u/Karthikstrom)
#### Post date: [March 30, 2024, 12:26pm UTC](https://discuss.gradle.org/t/got-an-error-plugin-was-not-found/46974/5 "2024-03-30T12:26:26Z")

</div>

Hi, migrating to Gradle plugin DSL resolved the issue for me [Deprecated imperative apply of Flutter's Gradle plugins | Flutter](https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply). FYI, I go the same error message as shared by the previous message but I will share the complete version when I face it again.
