4

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"
            }
        }
}
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841

2 Answers2

9

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.

NickUnuchek
  • 11,794
  • 12
  • 98
  • 138
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • 1
    I'm using latest google services and firebase app distribution gradle plugin, and have verified that my appId is present in the play services json, for my entire matrix of build type and flavor, and yet I get `Cannot query the value of task ':project:appDistributionUploadDevDebug' property 'appId' because it has no value available.` – Mark Dec 20 '22 at 15:15
0

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]
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Braian Coronel
  • 22,105
  • 4
  • 57
  • 62