androidfirebaseandroid-gradle-pluginfirebase-app-distribution

FirebaseAppDistribution: Missing app id in the appDistributionUpload gradle command


I am using the Firebase App Distribution with the Gradle plugin.
When I try to run the appDistributionUploadDebug command I receive the error:

Getting appId from output of google services plugin

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:appDistributionUploadDebug'.
> Missing app id

I included the plugin in the build.gradle file

   dependencies {
        classpath 'com.google.firebase:firebase-appdistribution-gradle:1.2.0'
    }

Then I added the config:

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

android {
   //...
        debug {
            firebaseAppDistribution {
                serviceAccountCredentials = "/path/to/your-service-account-key.json"
                releaseNotesFile="/path/to/releasenotes.txt"
                testers="email@example.com"
            }
        }
}

Solution

  • If you are not using the google services gradle plugin in your project you have to add the appId property in your configuration.

    Something like:

                firebaseAppDistribution {
                    // Firebase App Distribution setup
                    appId = "...."  //<-- add your appID
    
                    serviceAccountCredentials = "/path/to/your-service-account-key.json"
                    releaseNotesFile="/path/to/releasenotes.txt"
                    testers="email@example.com"
                }
    

    You can find the appId value in the google-services.json file

    {
      ...
      "client": [
        {
          "client_info": {
            "mobilesdk_app_id": "...",//<-- YOU NEED THIS APP_ID
            "android_client_info": {
              "package_name": "..."
            }
          },
         
      ...
    }
    

    or in the Firebase console on the Project Settings page -> General Tab.