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

4

12

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!

Duvetyn answered 24/1, 2022 at 18:46 Comment(3)
I have the same problem in CircleCI. I believe it's a bug in firebase-appdistribution-gradle:3.0.0. The weird thing is it works when I run the ./gradlew command directly from command line. However on a fresh checkout and when all caches (gradle etc.) are cleaned, on the first run, it fails from the command line too. On the second run, it works. The problem is that CI (GitHub actions/CircleCI) always runs on a fresh checkout.Theoretics
I sent this as a bug report in firebase.Theoretics
can write down the report link?Pemmican
C
6

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.

Carmelinacarmelita answered 7/2, 2022 at 10:54 Comment(0)
G
5

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.

Gybe answered 4/2, 2022 at 15:8 Comment(1)
They do provide indeed. Did you check here at all? firebase.google.com/support/release-notes/android#2022-01-20. However, I couldn't see any changelog related to this issue. It is highly likely a bug in 3.0.0 so we might have to wait for a newer version.Oleaginous
D
0

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.

Duvetyn answered 1/2, 2022 at 22:3 Comment(0)
K
0

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

Kish answered 24/5, 2022 at 14:33 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.