Search code examples
androidfirebasefirebase-app-distribution

Plugin with id 'com.google.firebase.appdistribution' not found


I am attempting to add Firebase App Distribution via Gradle to my Android app and seeing this error: 'Plugin with id 'com.google.firebase.appdistribution' not found.'

The app can build normally if I comment out 'apply plugin: 'com.google.firebase.appdistribution''

I have made a new sample app and am just trying to get it build with the plugin 'com.google.firebase.appdistribution'. I have followed these steps to a T (https://firebase.google.com/docs/app-distribution/android/distribute-gradle) and still am seeing this error

Here is my app module build.gradle:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'com.google.firebase.appdistribution'


android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    google()
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.1.0'

    implementation 'com.google.firebase:firebase-appdistribution-gradle:1.1.0'

    implementation 'com.google.firebase:firebase-analytics:17.2.1'

    implementation 'com.google.firebase:firebase-auth:19.1.0'
    implementation 'com.google.firebase:firebase-firestore:21.2.1'
}

apply plugin: 'com.google.gms.google-services'  // Google Play services Gradle plugin

I am expecting it to at least build but it seems it can't even find the plugin. Did upload it incorrectly or something?


Solution

  • This is not a Java dependency; it reads classpath and not implementation.

    You'd need to add that Gradle plugin into the root project's build.gradle:

    buildscript {
        repositories {
            google()
        }
        dependencies {
            classpath "com.google.firebase:firebase-appdistribution-gradle:1.1.0"
        }
    }