Gabriele Mariotti
Gabriele Mariotti

Reputation: 365148

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 protected]"
            }
        }
}

Upvotes: 5

Views: 7313

Answers (3)

Maxim Petlyuk
Maxim Petlyuk

Reputation: 1194

If you have multiple apps under the same firebase project, then you need to specify appId directly in gradle file - which app should be picked for uploading.

firebaseAppDistribution {
    appId = "from google-service.json file"

    serviceCredentialsFile = "..."
    artifactType = "APK"
    releaseNotesFile = "..."
    groups = "..."
}

Your google-services.json file

{
  ...
  "client": [
    {
      "client_info": {
        ...
        "mobilesdk_app_id": "app #1" // this is your app id
        ...
      }
    },
    {
      "client_info": {
        "mobilesdk_app_id": "app #2" // this is your app id
      }
    }
  ]
  ...
}

Upvotes: 2

Braian Coronel
Braian Coronel

Reputation: 22905

Distribute Android apps to testers using Gradle

Output error on appDistributionVersion 2.0.0:

Could not find the APK. Make sure you build first by running ./gradlew assemble[Variant]


So that the APK can be found, make sure you build first by running ./gradlew assemble[Variant] and then ./gradlew appDistributionUpload[Variant].

$ ./gradlew assemble[Variant] appDistributionUpload[Variant]

Upvotes: -1

Gabriele Mariotti
Gabriele Mariotti

Reputation: 365148

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 protected]"
            }

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.

Upvotes: 10

Related Questions