Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listing apps fails, due to the recent pricing update on App Store? #21125

Closed
4 tasks done
akkyie opened this issue Mar 10, 2023 · 95 comments · Fixed by #21187
Closed
4 tasks done

Listing apps fails, due to the recent pricing update on App Store? #21125

akkyie opened this issue Mar 10, 2023 · 95 comments · Fixed by #21187

Comments

@akkyie
Copy link

akkyie commented Mar 10, 2023

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:

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

... 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

@fastlane-bot
Copy link

It seems like you have not included the output of fastlane env
To make it easier for us help you resolve this issue, please update the issue to include the output of fastlane env 👍

@Glaubenio
Copy link

Same issue here

@tjolsen-vn
Copy link

tjolsen-vn commented Mar 10, 2023

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.

@tymcdowell
Copy link

Same here. We cannot upload using Fastlane.

@joshstrange
Copy link

joshstrange commented Mar 10, 2023

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.

@joshstrange
Copy link

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.

jffmrk added a commit to jffmrk/fastlane that referenced this issue Mar 11, 2023
@jffmrk
Copy link

jffmrk commented Mar 11, 2023

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

akkyie added a commit to abema/fastlane that referenced this issue Mar 13, 2023
akkyie added a commit to abema/fastlane that referenced this issue Mar 13, 2023
@manucodin
Copy link

Same here, im using fastlane with my CI environment and i cannot upload versions

eddiekaiger added a commit to voriteam/fastlane that referenced this issue Mar 14, 2023
@wow-such-amazing
Copy link

We are getting the same error today ➕

wow-such-amazing added a commit to wow-such-amazing/fastlane that referenced this issue Mar 14, 2023
wow-such-amazing added a commit to wow-such-amazing/fastlane that referenced this issue Mar 14, 2023
@CheeryLee
Copy link

Same error on 2.212.1 too.
@joshstrange's workaround helps out.

@ploth
Copy link

ploth commented Mar 15, 2023

Same here with ruby 3.0.0 and fastlane 2.212.1. @joshstrange's workaround helps out. 😘

willtho89 added a commit to willtho89/fastlane that referenced this issue Mar 15, 2023
zachawilson added a commit to SwitchCaseGroup/fastlane that referenced this issue Mar 16, 2023
@sck-v
Copy link

sck-v commented Mar 17, 2023

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')

@frenkyoptic
Copy link

@sck-v could you provide more details please? i put this into Fastfile, but no changes, still issue

@sck-v
Copy link

sck-v commented Mar 17, 2023

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

@maxTeste
Copy link

maxTeste commented Mar 17, 2023

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

I create all these steps in the pipeline

image

@xinatcg
Copy link

xinatcg commented Mar 17, 2023

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

@frenkyoptic
Copy link

For me, this was working only from Appfile

@tbenyon
Copy link

tbenyon commented Mar 17, 2023

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)

@xinatcg
Copy link

xinatcg commented Mar 17, 2023

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, maybe the version? we are on 2.211.0, maybe you can try upgrade

# fastlane 2.212.1 is available. You are on 2.211.0.

kalabiyau added a commit to topfreegames/fastlane that referenced this issue Mar 17, 2023
@jhong70
Copy link

jhong70 commented Mar 18, 2023

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)

# As of 2020-09-14:
# Official App Store Connect does not have an endpoint to get app prices for an app
# Need to get prices from the app's relationships
# Prices from app's relationship doess not have price tier so need to fetch app price with price tier relationship
app_prices = app.prices
if app_prices.first
app_price = Spaceship::ConnectAPI.get_app_price(app_price_id: app_prices.first.id, includes: "priceTier").first
old_price = app_price.price_tier.id
else
UI.message("App has no prices yet... Enabling all countries in App Store Connect")
territory_ids = Spaceship::ConnectAPI::Territory.all.map(&:id)
attributes[:availableInNewTerritories] = true
end

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
Copy link

sck-v commented Mar 18, 2023

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.

I bet monkeypatch may help here as well. Something like this should fix the exception

Spaceship::ConnectAPI::App.class_eval do 
  def prices 
    []
  end
end

@christruong90
Copy link

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

@memoriasIT
Copy link

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"

zachawilson added a commit to SwitchCaseGroup/fastlane that referenced this issue Jul 12, 2023
@hassan-ioki
Copy link

This is till causing issues with version 2.214.0. As our app was free, we just ignored the price updates but please look into a proper fix for this. 🙏

@Azeem00786
Copy link

Azeem00786 commented Jul 21, 2023

i am using fastlane version 2.214.0. and my app was free app but we are are still facing the issue. please suggest any proper solution

@LaGregance
Copy link

LaGregance commented Jul 25, 2023

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

@assembleMHN
Copy link

im also having this issue for 13 out of 62 apps released with fastlane, they use the exact same fastlane file, app file and deliver file, its the same app project released to 62 different accounts so its very weird that it would work for some of them and not others.

@pekq
Copy link

pekq commented Aug 8, 2023

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.

@gavrichards
Copy link

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.

@Arpanexe
Copy link

Arpanexe commented Dec 8, 2023

This issue occurs when we change the Base country or Region in pricing and availability section and select he base price for the app. For example by default base country or region is United States and if we change it to United Kingdom and choose the price as £0.00 or any other price, this issue occurs.

zachawilson added a commit to SwitchCaseGroup/fastlane that referenced this issue Jan 11, 2024
@lakshydeep-14
Copy link

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.

then what's the use of using fastlane for automation.
Isn't there any other solution for this.

pylapp added a commit to Orange-OpenSource/ods-ios that referenced this issue Jan 22, 2024
See fastlane/fastlane#21125

Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
pylapp added a commit to Orange-OpenSource/ods-ios that referenced this issue Jan 22, 2024
See fastlane/fastlane#21125

Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
pylapp added a commit to Orange-OpenSource/ods-ios that referenced this issue Jan 22, 2024
See fastlane/fastlane#21125

Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
@assembleMHN
Copy link

assembleMHN commented Feb 7, 2024

We are still having this issue, and reading the comments it looks like alot of other people are also still facing this, why has it be changed to closed?

@memoriasIT
Copy link

@assembleMHN Make sure you are using a newer version of fastlane
#21125 (comment)

Check your output to make sure you are using that version as well!

@assembleMHN
Copy link

@memoriasIT thank you for your response, im always on the newest, current on 2.220.0, and the issue sadly still persists.

@owurman
Copy link

owurman commented Apr 16, 2024

@assembleMHN We may have actually just had this recur today after having no issues (I think we removed price_tier from our Deliverfile, though). Maybe there's another change with the ASC API? Or a coincidence that we're both seeing it today.

zachawilson added a commit to SwitchCaseGroup/fastlane that referenced this issue Apr 18, 2024
@isamuhiro
Copy link

@assembleMHN We may have actually just had this recur today after having no issues (I think we removed price_tier from our Deliverfile, though). Maybe there's another change with the ASC API? Or a coincidence that we're both seeing it today.

Were you able to get rid from this error? We previously removed the price_tier as well but this error went back recently.

@owurman
Copy link

owurman commented Apr 24, 2024

Unfortunately, for me at least, it's still an issue (although we haven't updated Fastlane in a few versions). It's been low enough priority that I haven't dug into it, since we just create the ASC entries manually.

@owurman
Copy link

owurman commented Apr 24, 2024

Actually, I take it back. Our latest issue is #21820

We will update fastlane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.