Vetyr
Vetyr

Reputation: 43

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.

Upvotes: 2

Views: 1495

Answers (2)

Aniket Bhoite
Aniket Bhoite

Reputation: 116

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

Upvotes: 3

Ankur_009
Ankur_009

Reputation: 3730

Add

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

in project/build.gradle file and

Add

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

in app/build.gradle file below the android plugin

Upvotes: 1

Related Questions