11

I was working on Firebase App Distribution using gradle.

I already followed all steps from this firebase official link and it still doesn't work. When I run this ./gradlew assembleDemoDebug appDistributionUploadDemoDebug, it always return this error App Distribution failed to fetch app information: [403] The caller does not have permission .

Here's my gradle settings.

    buildTypes {
    debug {
        ...

        firebaseAppDistribution {
            appId = "1:12345678:android:12345678abc"
            releaseNotes = "test"
            groups = "android-qa"
            serviceCredentialsFile = "android-app-distribution-key.json"
        }
}

I already contacted the google support team, but maybe you guys have a similar experience with this issue. Am I missing something here?

Thanks

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Webster
  • 1,113
  • 2
  • 19
  • 39

1 Answers1

27

A couple things to try. First, make sure the service account has the needed permission. To confirm:

  1. Find the client_email in the service account file
  2. Go to GCP > select your Firebase project > click IAM & admin > click IAM https://console.cloud.google.com/iam-admin/iam?project=_
  3. Make sure the IAM row for the client_email in step 1 has the Firebase App Distribution Admin role, or add it if it is missing. Check by clicking the "edit" pencil icon to the right-side of the row and a panel will show the current roles. If Firebase App Distribution Admin isn't there, press "+ ADD ANOTHER ROLE" and include it.

Also, double check that you're using the most up to date version of the Gradle plugin: https://firebase.google.com/docs/app-distribution/android/distribute-gradle#step_1_set_up_your_android_project

Alexizamerican
  • 3,294
  • 19
  • 15
  • Hi bro, will check it a.s.a.p. will get back to you – Webster Jun 15 '20 at 13:32
  • this solved my problem! Thanks Alex! – Emanuele Tido Jun 15 '20 at 13:45
  • me too, it's solved. thanks – Webster Jun 15 '20 at 14:43
  • Awesome. I'll see what we can do to make this clearer – Alexizamerican Jun 15 '20 at 15:04
  • 4
    Gradle is up to date and the role is set right, but I still get the error :/ – Oleksandr Nos Nov 16 '20 at 11:36
  • same here @OleksandrNos, could you find a solution? – nyarian Dec 11 '20 at 16:10
  • @nyarian still no, we decided to wait for a stable release of App Distribution – Oleksandr Nos Dec 14 '20 at 16:23
  • @nyarian official support told me that they "can't find the service account [account@blabla.com] with a Firebase App Distribution Admin role." but it was there I swear :D will try that all again a bit later... – Oleksandr Nos Dec 14 '20 at 16:26
  • @OleksandrNos from what I found out it can be related to the hierarchy of gcloud projects (if there is a parent GCP environment specified for a firebase project). May be it tries to fetch some info from parent organization but it does not have enough permissions or something like that. All in all, we just deleted this firebase project and created a new one, not under a corporate account, and it worked right away – nyarian Dec 14 '20 at 17:13
  • I am getting same error. Account have correct access, Gradle version is upto date, It was working all fine a month back suddenly it stopped working now with the error > App Distribution failed to fetch app information: [403] The caller does not have permission My jenkins finally gives this error – Cyph3rCod3r Dec 23 '20 at 10:17
  • Can you see if the service account key has expired? Head to https://console.cloud.google.com/iam-admin/serviceaccounts (select your project). For the service account under "Actions" click "Edit". Scroll down to "Keys" and check the expiration date. – Alexizamerican Dec 23 '20 at 16:01
  • A few other things to check: 1) does the log output show that our gradle plugin is using the service credentials for auth? 2) is the service account for the right Firebase project, and is the google-services.json for the right project? 3) What happens if you make a new service account? Does it work? (could be related to my previous question about the expiration date, but maybe there's another issue we need to look into) – Alexizamerican Dec 23 '20 at 16:45
  • Sorry, quick clarification on #1 above, you need v1.4.1 or above of the App Distribution plugin to show the auth output method – Alexizamerican Dec 23 '20 at 17:11