fastlane: Listing apps fails, due to the recent pricing update on App Store?

New Issue Checklist

Issue Description

When I run the action app_store_build_number, it fails with an error response from Connect API: The request cannot be fulfilled because of the state of another resource. - The resource 'appPrices' cannot be viewed, created or updated. Please view and create 'manualPrices' using the resource 'appPriceSchedules'.

fastlane summary and stack trace
+------+----------------------------------+-------------+
|                   fastlane summary                    |
+------+----------------------------------+-------------+
| Step | Action                           | Time (in s) |
+------+----------------------------------+-------------+
| 1    | Switch to get_apple_api_key lane | 0           |
| 2    | app_store_connect_api_key        | 0           |
| šŸ’„   | app_store_build_number           | 0           |
+------+----------------------------------+-------------+

[14:47:58]: fastlane finished with errors
bundler: failed to load command: fastlane (/Users/distiller/project/vendor/bundle/ruby/3.0.0/bin/fastlane)
/Users/distiller/.rbenv/versions/3.0.5/bin/bundle: \e[31m[!] The request cannot be fulfilled because of the state of another resource. - The resource 'appPrices' cannot be viewed, created or updated. Please view and create 'manualPrices' using the resource 'appPriceSchedules'.\e[0m (Spaceship::UnexpectedResponse)
/Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/spaceship/lib/spaceship/connect_api/api_client.rb:204:in `handle_response': The request cannot be fulfilled because of the state of another resource. - The resource 'appPrices' cannot be viewed, created or updated. Please view and create 'manualPrices' using the resource 'appPriceSchedules'. (Spaceship::UnexpectedResponse)
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/spaceship/lib/spaceship/connect_api/api_client.rb:113:in `get'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/spaceship/lib/spaceship/connect_api/testflight/testflight.rb:22:in `get_apps'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/3.0.0/forwardable.rb:238:in `get_apps'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/spaceship/lib/spaceship/connect_api/models/app.rb:75:in `all'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/spaceship/lib/spaceship/connect_api/models/app.rb:81:in `find'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/actions/app_store_build_number.rb:53:in `get_build_info'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/actions/app_store_build_number.rb:23:in `get_build_version_and_number'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/actions/app_store_build_number.rb:12:in `run'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/runner.rb:229:in `chdir'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
	from Fastfiles/ReleaseFastfile.rb:96:in `block in parsing_binding'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/lane.rb:33:in `call'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/runner.rb:45:in `execute'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/commands_generator.rb:354:in `run'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/commands_generator.rb:43:in `start'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/gems/fastlane-2.212.1/bin/fastlane:23:in `<top (required)>'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/bin/fastlane:25:in `load'
	from /Users/distiller/project/vendor/bundle/ruby/3.0.0/bin/fastlane:25:in `<top (required)>'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/cli/exec.rb:58:in `load'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/cli/exec.rb:23:in `run'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/cli.rb:483:in `exec'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/cli.rb:31:in `dispatch'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/cli.rb:25:in `start'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/exe/bundle:48:in `block in <top (required)>'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
	from /Users/distiller/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/bundler-2.3.13/exe/bundle:36:in `<top (required)>'
	from /Users/distiller/.rbenv/versions/3.0.5/bin/bundle:23:in `load'
	from /Users/distiller/.rbenv/versions/3.0.5/bin/bundle:23:in `<main>'

Exited with code exit status 1

As far as I look over the stack trace, I suppose itā€™s caused by the recent pricing change on App Store and the related Connect API update. https://developer.apple.com/news/releases/?id=03092023b

The prices attribute included in ESSENTIAL_INCLUDES: https://github.com/fastlane/fastlane/blob/e55138d9dc769654897cf95701accc698d8edb01/spaceship/lib/spaceship/connect_api/models/app.rb#L60-L63

ā€¦ looks now marked as deprecated. https://developer.apple.com/documentation/appstoreconnectapi/app/relationships

Environment

gem "fastlane", "2.212.1"
āœ… fastlane environment āœ…

This is my local environment and it might be not so meaningful as the error above happened on my CI environment

Stack

Key Value
OS 13.1
Ruby 3.0.3
Bundler? true
Git git version 2.39.2
Installation Source hidden
Host macOS 13.1 (22C65)
Ruby Lib Dir ~/.rbenv/versions/3.0.3/lib
OpenSSL Version OpenSSL 1.1.1q 5 Jul 2022
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode-14.2.0.app/Contents/Developer/
Xcode Version 14.2
Swift Version 5.7.2

System Locale

Variable Value
LANG en_US.UTF-8 āœ…
LC_ALL en_US.UTF-8 āœ…
LANGUAGE en_US.UTF-8 āœ…

fastlane files:

`./fastlane/Fastfile`
import "Fastfiles/HelperFastfile.rb"
import "Fastfiles/ReleaseFastfile.rb"
import "Fastfiles/SandboxFastfile.rb"
import "Fastfiles/AppDistributionFastfile.rb"
import "Fastfiles/LicenseFastfile.rb"

before_all do
  ENV['TZ'] = 'Asia/Tokyo'
  ENV["REPO"] = "abema/abema-ios"
  ENV["SLACK_URL"] = ENV["SLACK_GENERAL_WEBHOOK"]
  ENV["SPACESHIP_ONLY_ALLOW_INTERACTIVE_2FA"] = "true"
  ENV["FASTLANE_IS_INTERACTIVE"] = "false"
  ENV["CI"]= "1"
end

No Appfile found

fastlane gems

Gem Version Update-Status
fastlane 2.212.1 āœ… Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-firebase_app_distribution 0.5.0 āœ… Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.5.0
bundler 2.3.13
pathname 0.1.0
rake 13.0.6
rexml 3.2.5
CFPropertyList 3.0.6
concurrent-ruby 1.2.0
i18n 1.12.0
minitest 5.17.0
tzinfo 2.0.6
zeitwerk 2.6.6
activesupport 6.1.7.2
public_suffix 4.0.7
addressable 2.8.1
httpclient 2.8.3
json 2.6.3
algoliasearch 1.27.5
artifactory 3.0.15
atomos 0.1.3
aws-eventstream 1.2.0
aws-partitions 1.716.0
aws-sigv4 1.5.2
jmespath 1.6.2
aws-sdk-core 3.170.0
aws-sdk-kms 1.62.0
aws-sdk-s3 1.119.1
babosa 1.0.4
claide 1.1.0
colored2 3.1.2
cork 0.3.0
nap 1.1.0
open4 1.3.4
claide-plugins 0.9.2
fuzzy_match 2.0.4
netrc 0.11.0
ffi 1.15.5
ethon 0.15.0
typhoeus 1.4.0
cocoapods-core 1.11.3
cocoapods-deintegrate 1.0.5
cocoapods-downloader 1.6.3
cocoapods-plugins 1.0.0
cocoapods-search 1.0.1
cocoapods-trunk 1.6.0
cocoapods-try 1.2.0
escape 0.0.4
fourflusher 2.3.1
gh_inspector 1.1.3
molinillo 0.8.0
ruby-macho 2.5.1
nanaimo 0.3.0
xcodeproj 1.22.0
cocoapods 1.11.3
colored 1.2
highline 2.0.3
commander 4.6.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
multipart-post 2.0.0
faraday-multipart 1.0.4
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.3
faraday-http-cache 2.4.1
rchardet 1.8.0
git 1.13.1
kramdown 2.4.0
kramdown-parser-gfm 1.1.0
no_proxy_fix 0.1.2
sawyer 0.9.2
octokit 5.6.1
unicode-display_width 1.8.0
terminal-table 1.8.0
danger 9.2.0
danger-plugin-api 1.0.0
danger-swiftformat 0.8.1
xcresult 0.2.1
danger-xcode_summary 1.2.0
declarative 0.0.20
digest-crc 0.6.4
unf_ext 0.0.8.2
unf 0.1.4
domain_name 0.5.20190701
dotenv 2.8.1
emoji_regex 3.2.3
excon 0.99.0
http-cookie 1.0.5
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.2.6
jwt 2.7.0
memoist 0.16.2
multi_json 1.15.0
os 1.1.4
signet 0.17.0
googleauth 1.3.0
mini_mime 1.1.2
trailblazer-option 0.1.2
uber 0.1.0
representable 3.2.0
retriable 3.1.2
webrick 1.8.1
google-apis-core 0.11.0
google-apis-androidpublisher_v3 0.34.0
google-apis-playcustomapp_v1 0.13.0
google-apis-iamcredentials_v1 0.17.0
google-apis-storage_v1 0.19.0
google-cloud-env 1.6.0
google-cloud-errors 1.3.0
google-cloud-core 1.6.0
google-cloud-storage 1.44.0
mini_magick 4.12.0
naturally 2.2.1
optparse 0.1.1
plist 3.7.0
rubyzip 2.3.2
security 0.1.3
simctl 1.6.10
terminal-notifier 2.0.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1
fastlane-plugin-firebase_app_distribution 0.5.0

generated on: 2023-03-10

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 54
  • Comments: 87 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Just use this in Fastfile. It will give you warning, that the constant is redefined, but you donā€™t need to maintain diffs and patches

Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')

Ok Iā€™m able to run pilot successfully after commenting out the ā€œpricesā€ array element. I have the following patchfile (fastlane-prices-fix.patch) in the root folder of my fastlane-related code (where I install my gems):

--- vendor/bundle/ruby/3.2.0/gems/fastlane-2.211.0/spaceship/lib/spaceship/connect_api/models/app-original.rb	2023-03-10 18:42:18.000000000 -0500
+++ vendor/bundle/ruby/3.2.0/gems/fastlane-2.211.0/spaceship/lib/spaceship/connect_api/models/app.rb	2023-03-10 18:42:39.000000000 -0500
@@ -59,7 +59,7 @@
 
       ESSENTIAL_INCLUDES = [
         "appStoreVersions",
-        "prices"
+#        "prices"
       ].join(",")
 
       def self.type

And I added the following to my GH Actions workflow:

      - name: Patch Fastlane
        run: |
          patch vendor/bundle/ruby/3.2.0/gems/fastlane-2.211.0/spaceship/lib/spaceship/connect_api/models/app.rb fastlane-prices-fix.patch

Obviously this only works if you use ruby 3.2.0 and fastlane 2.11.0 but the basic idea should work for any version of either.

I created the patch by starting in root of my project (after I copied app.rb to app-original.rb and commented out the "prices" line in app.rb) and running:

diff -Naur vendor/bundle/ruby/3.2.0/gems/fastlane-2.211.0/spaceship/lib/spaceship/connect_api/models/app-original.rb vendor/bundle/ruby/3.2.0/gems/fastlane-2.211.0/spaceship/lib/spaceship/connect_api/models/app.rb > fastlane-prices-fix.patch

(Again, adjust for ruby/fastlane version).

Nothing I did here is setting the world on fire but it unblocked me and so I wanted to share in case it helps someone else who was planning on using fastlane until this is fixed.

I fixed this issue on https://github.com/fastlane/fastlane/pull/21187.

It will be released on the next release šŸš€

Just use this in Fastfile. It will give you warning, that the constant is redefined, but you donā€™t need to maintain diffs and patches

Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')

base on our test this solution works,

require 'spaceship'
Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')

add these 2 lines in the top of Fastline file

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
require 'spaceship'
Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')
// THE OTHER CONTENT

I fixed this issue on #21187.

It will be released on the next release šŸš€

Any timescale on when this fix will be released? Unfortunately we canā€™t patch our CI/CD and it is breaking some of our builds.

Ahhh, not sure how I missed this issue šŸ˜± Will try to look into later today! So so sorry, everyone šŸ˜”

Still getting this error in 2.212.2

bundler: failed to load command: fastlane (/Users/xx/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/bin/fastlane) /Users/xx/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/fastlane-2.212.2/deliver/lib/deliver/upload_price_tier.rb:24:in upload': \e[31m[!] undefined method firstā€™ for nil:NilClass (NoMethodError)

  if app_prices.first
               ^^^^^^\e[0m

I fixed this issue on #21187.

It will be released on the next release šŸš€

Hi guys! When this issue is going to be reviewed and merged? Iā€™ve been seeing a lot of people still facing the same problem, even me and my teammates. Specially those who canā€™t use a patched version of fastlane due to some CIā€™s behavior

require 'spaceship'
Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')

this fixes the issue for me, though I believe Fastlane team should also put an update fix for this as this is breaking the flow.

Weā€™re still seeing this in 2.212.2:

upload_price_tier.rb:24:in `upload': \e[31m[!] undefined method `first' for nil:NilClass\e[0m (NoMethodError)

Any updates?

Just use this in Fastfile. It will give you warning, that the constant is redefined, but you donā€™t need to maintain diffs and patches

Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')

base on our test this solution works,

require 'spaceship'
Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')

add these 2 lines in the top of Fastline file

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
require 'spaceship'
Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')
// THE OTHER CONTENT

We tried this but are now getting this error:

bundler: failed to load command: fastlane (/usr/local/bin/fastlane)
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.205.2/deliver/lib/deliver/upload_price_tier.rb:22:in `upload': [31m[!] undefined method `first' for nil:NilClass[0m (NoMethodError)

Not sure if anyone pointed it out, but this method also has a problem caused by this same issue (deprecation of App <-> Prices relationship on App Store Connect API).

Specifically, these two lines will produce a nil pointer error because apps do not have the price property anymore.

Not sure if Iā€™m the only one?

I tried multiple monkey patching but always end up with some error

Latest try, based on @giginet https://github.com/giginet/fastlane/pull/1/commits

Results in an API error : The request cannot be fulfilled because of the state of another resource. - The resource 'appPrices' cannot be viewed, created or updated. Please view and create 'manualPrices' using the resource 'appPriceSchedules'

fastlane code runs though, but do not send the right info. Quite hard to debug as this inside a CI job and i can not really do trials and errors easily. In the end the API connector must be fixed and monkey patching will not be enough.

To add more context, this happens only with apps that have been just created, with the pricing config done manually. We are able to update app that have been untouched since apple change.

  ESSENTIAL_INCLUDES = [
         "appStoreVersions",
-        "prices"
+#        "prices"
       ].join(",")
 
       def self.type

This is awesome, worked as a charm! But what I found interesting is that it happened two cases with me

The first one Iā€™ve just created an app in the app store And without any further configuration made the upload with fastlane It worked normally, as usual Notice that in this case I hadnā€™t configured the price yet

In the second app, Iā€™ve created the app in the app store But this time I started to configure the store with necessary information, including the prices Only then I proceed to submit the app with fastlane, and in this case it showed the above error

So it seems that if you set the prices before submiting the app this error occurs, but if you skip the prices fastlane can upload the app without any issues. After that you can set the prices with no problem

Iā€™m having this problem when trying to setup Fastlane to a new app. Fastlane init fails with this error.

Thanks @joshstrange - that worked for me too. I forked the repo, committed the change, and updated Gemfile to use my forked repo.

Same here. We cannot upload using Fastlane.

This item seems like a complete show stopper for any CI/CD process using Fastlane to deploy to Apple.

None of the workarounds suggested up to this point work any more.

Same for me. Azure DevOps

Yep, we ran into the same issue when uploading to the AppStore with Fastlane.

Edit: Also verified we can manually archive and distribute. So doesnā€™t seem to be a code issue or even an Apple issue. But something with the pricing updates has caused an issue with Fastlane specifically.

Edit: removing price_tier: 0 from deliverā€™s parameters fixed the issue.

~We are also seeing this error and forcing us not to use Fastlane for app updates. Using version 2.214.0 and attempting to update a free app.~

I am still seeing this issue on the new fastlane update 2.213.0: image

FYI: we experienced this same problem and updated to fastlane 2.212.2 and that fixed the issue without any other changes.

Got around it by commenting out price tier from our deliver call and setting it manually in ASC. If you are just releasing a new version of your app it should use the existing pricing.

Sorry, just to confirm. Youā€™re saying that if the price is set in app store connect, and not in fastlane, it will not overwrite the price and the publish will work?

Because thatā€™s good enough for me at the moment.

Seems to work that way for us. Give it a shot and check the listing before submitting for review

Any workaround for bitrise or fix being deployed?

Weā€™re using https://github.com/bitrise-steplib/steps-deploy-to-itunesconnect-deliver step. And it started failing about a week or 2 ago.

Same problem for me.

Just use this in Fastfile. It will give you warning, that the constant is redefined, but you donā€™t need to maintain diffs and patches

Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')

base on our test this solution works,

require 'spaceship'
Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')

add these 2 lines in the top of Fastline file

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
require 'spaceship'
Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions')
// THE OTHER CONTENT

We tried this but are now getting this error:

bundler: failed to load command: fastlane (/usr/local/bin/fastlane)
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.205.2/deliver/lib/deliver/upload_price_tier.rb:22:in `upload': [31m[!] undefined method `first' for nil:NilClass[0m (NoMethodError)

https://github.com/fastlane/fastlane/blob/e55138d9dc769654897cf95701accc698d8edb01/deliver/lib/deliver/upload_price_tier.rb#L19-L32

I have a similar issue for a completely new app weā€™re building where prices havenā€™t been set before. I edited the code to return early and seems to have fixed the issue. The correct solution is to update fastlane to handle the new price App Store Connect API updates.

if app_prices.nil? UI.message("App has no prices yet... No changes required." return end

@sck-v @joshstrange any idea how can I try that solution on azure devops? image

I create all these steps in the pipeline

image

Just ran into this issue as well.

I sort of need my CI to be building my apps (secrets, config steps that run, etc) so I started testing locally and just commenting out ā€œpricesā€ fixes the problem (unsurprisingly):

 ESSENTIAL_INCLUDES = [ 
   "appStoreVersions", 
 #  "prices" 
 ].join(",") 

Of course if you make use of prices via fastlane it will probably break but I donā€™t. Iā€™m going to look into patching this file on the fly in my CI to comment out that line to see if I can successfully get pilot to complete.

I just hit this. If you comment out price_tier: 0 as suggested above, you get past this point, but then at the very end of submission you get

appStoreVersions with id ā€˜XXXā€™ is not in valid state. - This resource cannot be reviewed, please check associated errors to see why. App is missing required pricing. - App is not eligible for submission until pricing has been set.

I then manually went into App Store Connect, selected free, all countries, and then everything went through ok.

I have the same problem since I sent the app for review (not sure if itā€™s related, but itā€™s the 1st time Iā€™ve sent a new build since). EDIT: I was on fastlane 2.211.0 but itā€™s working with 2.214.0

For me using version 2.213.0 fixed the issue. Make sure you are using that version if you have different ones installed. I used the following line in the Gemfile: gem "fastlane", "2.213.0"

Iā€™m also having the same problem. Is there a fix yet? I tried adding the Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions') but still not able to set the price

CleanShot 2023-05-21 at 09 32 39@2x

Iā€™m experiencing this issue on the lastest version of fastlane.

I tried adding Spaceship::ConnectAPI::App.const_set('ESSENTIAL_INCLUDES', 'appStoreVersions') to the fastfile but didnā€™t have any luck.

Hello!

Based on the comments above, I canā€™t get a clear answer as to if this issue has been fixed on a recent fastlane release or not. We donā€™t have explicit pricing set on our products as they are free apps and nowhere in our fastfile is ā€œpricesā€ mentioned. Yet the error remains. I updated our project to version 2.112.2 and we will be pushing a new version out next week after regression. Based on the comments, I donā€™t feel very confident that 2.112.2 will fix the issue. Can someone give me a more solid answer please?

i have just update my fastlane version and itā€™s done

Iā€™m using a bitrise step that uses fastlane and Iā€™m still getting a crash.

Not sure if its a bug in fastlane or in the bitrise step

[10:27:37]: wrong number of arguments (given 2, expected 1)
/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/rubyzip-3.0.0.alpha/lib/zip/file.rb:92:in `open'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb:68:in `fetch_info_plist_with_rubyzip'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb:41:in `fetch_info_plist_file'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb:18:in `fetch_app_version'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/deliver/lib/deliver/detect_values.rb:73:in `find_version'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/deliver/lib/deliver/detect_values.rb:20:in `run!'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/deliver/lib/deliver/runner.rb:25:in `initialize'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/deliver/lib/deliver/commands_generator.rb:82:in `new'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/deliver/lib/deliver/commands_generator.rb:82:in `block (2 levels) in run'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/deliver/lib/deliver/commands_generator.rb:187:in `run'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/deliver/lib/deliver/commands_generator.rb:18:in `start'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/fastlane/lib/fastlane/cli_tools_distributor.rb:115:in `take_off'\n/Users/vagrant/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/fastlane-2.212.2/bin/fastlane:23:in `<top (required)>'\n/Users/vagrant/.rbenv/versions/2.7.5/bin/fastlane:23:in `load'\n/Users/vagrant/.rbenv/versions/2.7.5/bin/fastlane:23:in `<main>'
[!] Could not infer your app's version
Deploy failed, error: exit status 1

Bitrise issue #130

We use @joshstrangeā€™s script above to patch Fastlane, which we install through a Gemfile and bundle install --deployment, to find the right file and patch it. Maybe someone can improve on it, but it works great for us.

#!/bin/sh

FASTLANE_DIR=`find vendor -type d -regex ".*/fastlane-[0-9]*\.[0-9]*\.[0-9]*"`

echo "Patching fastlane in $FASTLANE_DIR"

# https://github.com/fastlane/fastlane/issues/21125#issuecomment-1464684522
cat << EOF > .fastlane-prices-fix.patch
--- $FASTLANE_DIR/spaceship/lib/spaceship/connect_api/models/app-original.rb   2023-03-10 18:42:18.000000000 -0500
+++ $FASTLANE_DIR/spaceship/lib/spaceship/connect_api/models/app.rb    2023-03-10 18:42:39.000000000 -0500
@@ -59,7 +59,7 @@

       ESSENTIAL_INCLUDES = [
         "appStoreVersions",
-        "prices"
+#        "prices"
       ].join(",")

       def self.type
EOF

patch -N $FASTLANE_DIR/spaceship/lib/spaceship/connect_api/models/app.rb .fastlane-prices-fix.patch
rm .fastlane-prices-fix.patch

@MiguelSOliveira - I have the same issue. The app where I did a manual change has the same issue.

My app was already created but I did do a manual change when apple brought these changes. So I guess itā€™s not so much ā€œjust createdā€ but ā€œupdated manuallyā€ that could be causing the problem, maybe?

Tried to apply the changes from the PR above but getting this error:

bundler: failed to load command: fastlane (/app/ios/vendor/bundle/ruby/2.6.0/bin/fastlane)
NoMethodError: [!] undefined method `first' for nil:NilClass
  /app/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.212.1/deliver/lib/deliver/upload_price_tier.rb:24:in `upload'
  /app/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.212.1/deliver/lib/deliver/runner.rb:161:in `upload_metadata'
  /app/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.212.1/deliver/lib/deliver/runner.rb:61:in `run'
  /app/ios/vendor/bundle/ruby/2.6.0/gems/fastlane-2.212.1/fastlane/lib/fastlane/actions/upload_to_app_store.rb:22:in `run'

Not sure if Iā€™m the only one?

For Azure DevOps, with Šzure hosted macOS agent seems to fix that with shell exec step, after installation on fastlane

sudo sed -i ' ' '61d' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.212.1/spaceship/lib/spaceship/connect_api/models/app.rb
sudo sed -i ' ' '61s/.*/"appStoreVersions"/' /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.212.1/spaceship/lib/spaceship/connect_api/models/app.rb

Šdd PowerShell task to install sudo gem install fastlane -NV Add Shell Exec Task with the following code above.If you receive any errors related with Permissions Denied add this line at the first line sudo chmod 777 /usr/local/lib/ruby/gems/2.7.0/gems/fastlane-2.212.1/spaceship/lib/spaceship/connect_api/models/app.rb running fastlane ios test flight track successfully

Same problem here, using bitrise :c

I am facing the same error with the version 2.211.0. Any news? Using a patched fastlane version is not practicable in my case

Guys I confirm itā€™s worked fine with me once I added Apple ID (You can find it in app information from Apple Store Connect) image

I also had the nil app_prices issue and included that patch in my fork.

The monkey patching didnā€™t work for me. I am not sure why, but I will comment that we are pulling in our own fastlane plugin to iterate on our custom logic and share across our organization. When I attempted the monkey patching, I did it in the main Fastfile and not in the plugin.

but no changes, still issue

Maybe you would also need to require 'spaceship' before that line. We have quite complex fastlane setup, so this may be the key as well

We are getting the same error today āž•