Search code examples
androidgradlebuild.gradlefirebase-app-distribution

Could not find method firebaseAppDistribution() for arguments


I am trying to implement Firebase App Distribution through Gradle but after I have added this:

firebaseAppDistribution {
                releaseNotes="Some release notes"
                testers="[email protected]"
            }

and click Sync Now for the Gradle to sync with the project, the build fails with:

Could not find method firebaseAppDistribution() for arguments [...], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.

I have also added these:

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

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

Does anyone have any idea why the build might be failing?

Thanks in advance.


Solution

  • Sequence of apply plugin matters

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

    firebase.appdistribution plugin should be just below android.application plugin