fastlane: android - Invalid request

New Issue Checklist

Issue Description

Getting invalid request without returning what it’s invalid.

Command executed

fastlane android release

Complete output when running fastlane, including the stack trace and command used
+--------------------------------------------------------------------------------------------------------------+
|                                          Summary for supply 2.217.0                                          |
+------------------------------------+-------------------------------------------------------------------------+
| package_name                       | [redacted]                                                      |
| json_key                           | ./fastlane/PlayStoreAuth.json                                           |
| rollout                            | 1                                                                       |
| metadata_path                      | ./fastlane/metadata                                                     |
| aab                                | ./android/app/build/outputs/bundle/release/app-release.aab |
| skip_upload_images                 | true                                                                    |
| skip_upload_screenshots            | true                                                                    |
| skip_upload_metadata               | true                                                                    |
| timeout                            | 600                                                                     |
| release_status                     | completed                                                               |
| track                              | production                                                              |
| skip_upload_apk                    | false                                                                   |
| skip_upload_aab                    | false                                                                   |
| skip_upload_changelogs             | false                                                                   |
| sync_image_upload                  | false                                                                   |
| track_promote_release_status       | completed                                                               |
| validate_only                      | false                                                                   |
| check_superseded_tracks            | false                                                                   |
| deactivate_on_promote              | true                                                                    |
| changes_not_sent_for_review        | false                                                                   |
| rescue_changes_not_sent_for_review | true                                                                    |
| ack_bundle_installation_warning    | false                                                                   |
+------------------------------------+-------------------------------------------------------------------------+
#<Thread:0x00000001080664a0 /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fastlane-2.217.0/fastlane_core/lib/fastlane_core/queue_worker.rb:37 run> terminated with exception (report_on_exception is true):
/Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fastlane-2.217.0/fastlane_core/lib/fastlane_core/ui/interface.rb:184:in `abort_with_message!': android - Invalid request (FastlaneCore::Interface::FastlaneCommonException)
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fastlane-2.217.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fastlane-2.217.0/supply/lib/supply/uploader.rb:526:in `rescue in block in create_meta_upload_worker'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fastlane-2.217.0/supply/lib/supply/uploader.rb:517:in `block in create_meta_upload_worker'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fastlane-2.217.0/fastlane_core/lib/fastlane_core/queue_worker.rb:40:in `block (2 levels) in start'
/Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.2/lib/google/apis/core/http_command.rb:244:in `check_status': Invalid request (Google::Apis::ClientError)
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.2/lib/google/apis/core/api_command.rb:135:in `check_status'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.2/lib/google/apis/core/http_command.rb:207:in `process_response'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.2/lib/google/apis/core/http_command.rb:326:in `execute_once'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.2/lib/google/apis/core/http_command.rb:131:in `block (2 levels) in do_retry'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.2/lib/google/apis/core/http_command.rb:128:in `block in do_retry'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:61:in `block in retriable'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `times'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/retriable-3.1.2/lib/retriable.rb:56:in `retriable'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.2/lib/google/apis/core/http_command.rb:118:in `do_retry'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.2/lib/google/apis/core/http_command.rb:109:in `execute'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-core-0.11.2/lib/google/apis/core/base_service.rb:418:in `execute_or_queue_command'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/google-apis-androidpublisher_v3-0.53.0/lib/google/apis/androidpublisher_v3/service.rb:1181:in `get_edit_listing'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fastlane-2.217.0/supply/lib/supply/client.rb:238:in `listing_for_language'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fastlane-2.217.0/supply/lib/supply/uploader.rb:519:in `block in create_meta_upload_worker'
	from /Users/user1/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/fastlane-2.217.0/fastlane_core/lib/fastlane_core/queue_worker.rb:40:in `block (2 levels) in start'

Environment

| Gem      | Version | Update-Status |
| -------- | ------- | ------------- |
| fastlane | 2.217.0 | ✅ Up-To-Date  |
| google-apis-core                       | 0.11.2       |
| google-apis-androidpublisher_v3        | 0.53.0       |
| google-apis-playcustomapp_v1           | 0.13.0       |
| google-apis-iamcredentials_v1          | 0.17.0       |
| google-apis-storage_v1                 | 0.29.0       |
| google-cloud-env                       | 1.6.0        |
| google-cloud-errors                    | 1.3.1        |
| google-cloud-core                      | 1.6.0        |
| google-cloud-storage                   | 1.45.0       |

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 8
  • Comments: 22

Most upvoted comments

In my case, i was using app bundle id instead of Firbase app ID in app property.

  1. make sure you clicked Get Started on every single app under your firebase project > AD
  2. make sure using Firbase app ID in app property
  3. make sure group property is containing the group name with dashes and not with spaces as mentioned by firebase console (check screenshot) e.g. Testers Group use testers-group
Screenshot 2024-04-26 at 18 05 43 Screenshot 2024-04-26 at 18 08 43

Check firebase app ID on the firebase console.

I just got this too. Couple additional data points in my case:

  1. It created the release in Firebase but didn’t do the tester distribution step
  2. I didn’t specify any release notes and my tester group name contains a space i.e. “Internal Testers” in case that might be a problem

For me it created the release and distributed it, but then failed afterwards:

INFO [2024-04-12 11:05:17.67]: ✅ Uploaded IPA successfully and created release 1.0 (0).
INFO [2024-04-12 11:05:17.68]: 📜 Setting release notes.
INFO [2024-04-12 11:05:18.66]: 📦 Distributing release.
WARN [2024-04-12 11:05:19.53]: Lane Context:
INFO [2024-04-12 11:05:19.53]: {:PLATFORM_NAME=>nil, :LANE_NAME=>"distribute"}
ERROR [2024-04-12 11:05:19.53]: Invalid request

And I could see the build on Firebase, it’s downloadable and it works too. Just that it errors out here.

One thing I figured:

  • When I create the Firebase project + App by hand (clicking through the UI), Firebase setup works just fine with Fastlane. It is able to handle everything without errors
  • When I do Firebase project + App creation by Terraform (so, in code), the setup does not work. Might have been a problem with Google provider for Terraform… But if this was the case, I’m guessing then everyone else here created their projects with Terraform?

Edit:

  • I now have figured out the issue I experienced. I had a group that Fastlane was trying to distribute to, but that group did not exist on Firebase. So, I had to create it, that ended up fixing the issue. It no longer errors out like that ☝️

The issue is that the firebase app distribution plugin hide too much of the error, you could get this error for many different reason and I’ll argue that the fix to THIS bug would be to implement a proper error handling that gives actually useful information rather than a very useless “Invalid Request” I’m sure firebase is giving a proper error in return, the plugin is not logging it.

Hello! I’ve had the same problem with my fastlane to firebase app distribution. Solution was to

  1. Update your firebase tools
  2. Make sure you go to the app distribution page and click get started button (otherwise it won’t work)

good luck!

Just encountered this issue as well, still working on debugging.

But my fastlane is on version 2.219.0 and fastlane-plugin-firebase_app_distribution is on 0.9.0

@wjbeau @tommysuds same here… it creates the release but it does not distribute… and the only feedback I have is “Invalid request”

I solved this problem after recreating the service account file from the Firebase console. I had previously created it from the google cloud console page and it did not work.

Had the same issue the metadata folder looked like this: “fastlane/metadata/android/en-US/changelogs” fixed it by removing the android folder so now it looks like this: “fastlane/metadata/en-US/changelogs”

@wjbeau 's comment gave me the clues to solve this issue. My tester group also contained space. So instead of Internal Testers, you should use internal-testers to escape the space.

I’m seeing this issue as well and like @wjbeau , it still created the release. I was able to add release notes