fastlane: [!] Google Api Error: Invalid request - The caller does not have permission when uploading Android App bundle on MacOS
New Issue Checklist
- [ x ] Updated fastlane to the latest version
- [ x ] I read the Contribution Guidelines
- [ x ] I read docs.fastlane.tools
- [ x ] I searched for existing GitHub issues
Issue Description
Command executed
bundle exec fastlane android deploy upload
Complete output when running fastlane, including the stack trace and command used
Here is my output:
[✔] 🚀
[17:44:00]: ------------------------------
[17:44:00]: --- Step: default_platform ---
[17:44:00]: ------------------------------
[17:44:00]: Driving the lane 'android deploy' 🚀
[17:44:00]: ----------------------------------
[17:44:00]: --- Step: upload_to_play_store ---
[17:44:00]: ----------------------------------
+------------------------------------+--------------------------------------------------+
| Summary for supply 2.211.0 |
+------------------------------------+--------------------------------------------------+
| package_name | com.nothing.game.gelwix |
| release_status | completed |
| track | production |
| json_key | pc-api-5388874122748755929-382-3edf7cf6fb7b.json |
| skip_upload_apk | false |
| skip_upload_aab | false |
| skip_upload_metadata | false |
| skip_upload_changelogs | false |
| skip_upload_images | false |
| skip_upload_screenshots | false |
| track_promote_release_status | completed |
| validate_only | false |
| check_superseded_tracks | false |
| timeout | 300 |
| deactivate_on_promote | true |
| changes_not_sent_for_review | false |
| rescue_changes_not_sent_for_review | true |
| ack_bundle_installation_warning | false |
+------------------------------------+--------------------------------------------------+
+------------------+----------------+
| Lane Context |
+------------------+----------------+
| DEFAULT_PLATFORM | android |
| PLATFORM_NAME | android |
| LANE_NAME | android deploy |
+------------------+----------------+
**[17:44:01]: Google Api Error: Invalid request - The caller does not have permission**
How I fixed it:
Go to the Google Play Console and find the API Access Section under Setup -> API Access in the navigation panel on the left

On the API Access page click the “View Play Console permissons” link. You may have to scroll down a bit. It’s going to be attached to the service account that you made for your app.

Click on the “Account permissions” tab

Click the Admin checkmark in the “App Access” section and this will fix your error.

I hope perhaps my instructions can be added to the documentation. I took me at least 3 weeks to figure this out, and although I know Fastlane itself is not responsible for my Google Cloud Administration work, it would have REALLY helped me if this was in the Setup Documentation for Android Fastlane
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 14
- Comments: 16
Try to this solution
firebase-adminsdk-srk1p@project1.iam.gserviceaccount.comit works!
Gave admin access but still the same error
Here is the fastlane env output:
`./fastlane/Appfile`
fastlane gems
Loaded fastlane plugins:
No plugins Loaded
Loaded gems
I will look into how easy it is to make a PR for the fastlane documentation soon, I’m not sure if this is something I can do myself or if I have to collaborate with others.
The points given in 18 and 19 made it work for me
https://support.pushpay.com/s/article/Setting-up-your-Google-Publishing-API
(i.e) the email address in the json-key file, we need to add it as a user who has access to upload (admin) and then it works
Maybe this will help someone else: I got this error because I only granted admin rights to the app that this key is used to deploy. However, I had to grant admin rights to the entire account.