0

I am trying to upload APK to Firebase using Gradle as mentioned below

./gradlew assembleRelease appDistributionUploadRelease -Dhttps.proxyHost=10.xx.xx.xx -Dhttps.proxyPort=8080 "-Dhttps.nonProxyHosts=localhost" --stacktrace

However, it failed with the following error

Error

Caused by: com.google.api.client.http.HttpResponseException: 403 Forbidden
POST https://firebaseappdistribution.googleapis.com/upload/v1/projects/xxxxxxxxx/apps/1:xxxxxxxxx:android:0a4f47b9fe3f6250/releases:upload
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission",
    "status": "PERMISSION_DENIED"
  }
}

I referred this link to resolve the issue but with NO luck

  1. Upgraded Gradle plugin to use latest version build.gradle

  2. Provided following permissions to client_email in ServiceAccount

  • Firebase Admin
  • Firebase App Distribution Admin
  • Firebase App Distribution Admin SDK Service Agent
  • Owner
  • Service Account User

I saw similar issues in SO but not sure what am I missing

Sathish Kumar
  • 2,150
  • 10
  • 29
  • 51

1 Answers1

0

Had the same issue and in my case project id from API call was different from the project id where I have Service Account with the role Firebase App Distribution Admin.

So please double check that xxxxxxx from this URL POST https://firebaseappdistribution.googleapis.com/upload/v1/projects/xxxxxxxxx/ is exactly the same where you have SA that is used to access this API.

NOTE: to see API calls in logs would be enough to add --info option to you ./gradlew command e.g. ./gradlew --debug <task>

Alex A.
  • 39
  • 1
  • 4