TootsieRockNRoll
TootsieRockNRoll

Reputation: 3298

firebaseAppDistribution with Github Actions throwing error "Missing app id", even with google services plugin set

I'm implementing app distribution for android with github actions, everything seems to be okay but I'm getting an error:

* What went wrong:
Execution failed for task ':app:appDistributionUploadQaRelease'.
> Missing app id. Please check that it was passed in and try again

I'm using google play plugin so it should get the app id automatically.

https://firebase.google.com/docs/app-distribution/android/distribute-gradle#step_3_configure_your_distribution_properties

appId -- Your app's Firebase App ID. Required only if you don't have the Google Services Gradle plugin installed.

I have google-services.json file in app module,

in root build.gradle:

classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-appdistribution-gradle:3.0.0' 

in app's build.gradle:

plugins {
....
    id 'com.google.gms.google-services'
    id 'com.google.firebase.appdistribution'
}

in qa flavour:

productFlavors {
   ....
    qa {
        applicationId "custom.package.for.qa"
        ....
        firebaseAppDistribution {
            releaseNotes =  "something 123"
            groups = "testers"
        }
    }
}

if I add "appId = ...." inside firebaseAppDistribution, the build is uploaded successfully. but this shouldn't be necessary because of google play plugin.

and in github action:

-   name: Build & Deploy
    run: |
        export FIREBASE_TOKEN=${{ secrets.FIREBASE_TOKEN }}
        ./gradlew --stop
        ./gradlew clean
        ./gradlew assembleQaRelease appDistributionUploadQaRelease

Thanks!

Upvotes: 12

Views: 1693

Answers (4)

Shefchenko
Shefchenko

Reputation: 113

Adding the google-services plugin worked for me. I'm using the firebase-appdistribution-gradle:3.0.1

Upvotes: 0

mtrakal
mtrakal

Reputation: 6427

It's a bug in 3.0.0 which fails in some cases.

So temporarily downgrade to: com.google.firebase:firebase-appdistribution-gradle:2.2.0

I had the same issue with 3.0.0 but on Bitbucket pipelines using Service account for upload. Same build just with updated to 3.0.0 fails, with 2.2.0 is Ok.

Because Google don't provide Changelog for Firebase app distribution, we can't validate if they change something in configuration. It looks, that App distribution stops searching for AppId in google-services.json file.

Reply from Google:

I just received feedback from our engineering team. Our investigation confirms that this is a bug, and because of this, we apologize for the impact that this may have caused during your distribution process. They're working on rolling out a fix for this issue, but this will most likely be available in a newer version of the SDK. We won't be able to share any timelines at the moment that would confirm exactly when this bug will be fixed. For now, you can regularly check for updates on our release notes, or from the main issue thread in GitHub.

Upvotes: 5

tzegian
tzegian

Reputation: 589

I also confirm it's a bug in the latest version of their library:

com.google.firebase:firebase-appdistribution-gradle:3.0.0

I opened an issue on their GitHub so hopefully they will fix it soon.

Upvotes: 6

TootsieRockNRoll
TootsieRockNRoll

Reputation: 3298

I got a reply from firebase support, unfortunately it DOES NOT work for me still, but he was able to reproduce the issue and then resolved it by doing the following, hopefully it will fix it for someone else :

Add the Firebase SDK plugins in your build.gradle (project) file. See Figure 1.0.
Apply the Firebase SDK plugins in your build.gradle (app) file. See Figure 2.0.
Make sure that you have a google-services.json file in your app folder.
Rebuild and Upload your APK to Firebase App Distribution using the commands below:
    In a terminal window, run gradlew assembleDebug.
    In a terminal window, run gradlew appDistributionUploadDebug.

Figure 1.0 - build.gradle (project)

buildscript {
     // …
     dependencies {
        // Firebase SDK - Plugins
        classpath 'com.google.gms:google-services:4.3.10'   // Google Services
        classpath 'com.google.firebase:firebase-appdistribution-gradle:3.0.0' // App Distribution
    }
}

Figure 2.0 - build.gradle (app)

plugins {
    // …
    id 'com.google.gms.google-services' // Google Services
    id 'com.google.firebase.appdistribution' // App Distribution
}

android {
     // …
    buildTypes {
        debug {
            firebaseAppDistribution {
                artifactType="APK"
                releaseNotes="..."
                testers="[email protected]"
           }
       }
    }
    // …
}

dependencies {
    // …
    implementation platform('com.google.firebase:firebase-bom:29.0.4')  // bom
    implementation 'com.google.firebase:firebase-analytics-ktx'         // analytics
}

I have my project set to exactly this, but for some reason github actions still fails with missing id.

Upvotes: 0

Related Questions