fastlane: Produce fails to create app on AppStoreConnect with error Bundle ID already used

New Issue Checklist

Issue Description

I am trying to create new Apps on AppStoreConnect using an script that I have and that worked many times in the past.

Right now, it is failing with the following error being thrown

[20:07:54]: Creating new app 'XXXXXX' on iTunes Connect
The `version` parameter is deprecated. Use `ensure_version!` method instead
/Users/guilhermeg/.rvm/gems/ruby-2.4.9/gems/fastlane-2.150.0.rc1/spaceship/lib/spaceship/tunes/tunes_client.rb:230:in `handle_itc_response': The Bundle ID you entered has already been used. The Bundle ID you entered has already been used. (Spaceship::Tunes::Error)
	from /Users/guilhermeg/.rvm/gems/ruby-2.4.9/gems/fastlane-2.150.0.rc1/spaceship/lib/spaceship/tunes/tunes_client.rb:325:in `create_application!'
	from /Users/guilhermeg/.rvm/gems/ruby-2.4.9/gems/fastlane-2.150.0.rc1/spaceship/lib/spaceship/tunes/application.rb:96:in `create!'
	from /Users/guilhermeg/.rvm/gems/ruby-2.4.9/gems/produce-2.0.0/lib/produce/itunes_connect.rb:25:in `create_new_app'
	from /Users/guilhermeg/.rvm/gems/ruby-2.4.9/gems/produce-2.0.0/lib/produce/itunes_connect.rb:12:in `run'
	from /Users/guilhermeg/.rvm/gems/ruby-2.4.9/gems/produce-2.0.0/lib/produce/manager.rb:8:in `start_producing'
	from create_itc_apps.rb:66:in `block in <main>'
	from create_itc_apps.rb:59:in `map'
	from create_itc_apps.rb:59:in `<main>'

It is as though the AppStoreConnect returned this error message. However I believe it may be due the latest update on AppStoreConnect and some part of our API that broke with it.

When I go to AppStoreConnect and create the App with same bundleID though the Web Interface, it works. So the Bundle ID is indeed valid. The error is misleading

I upgraded to 2.150.rc1 as mentioned on issue #16621 and #16639 to no avail.

Command executed

I execute a ruby script that runs the following

FastlaneCore::CommanderGenerator.new.generate(Produce::Options.available_options)
    Produce.config = FastlaneCore::Configuration.create(Produce::Options.available_options, options)
    puts Produce::Manager.start_producing

The options passed as argument are:

app_identifier: bundle_id,
    sku: bundle_id,
    app_name: "MyApp",
    app_version: "1.0.0",
    language: 'English',
    platform: "ios",
    team_id: 'XYZXYZ',
    itc_team_id: 00000,
    itc_team_name: 'My Company',
    skip_devcenter: true,
    username: username

Environment

 ### Stack
Key Value
OS 10.14.5
Ruby 2.4.9
Bundler? false
Git git version 2.21.1 (Apple Git-122.3)
Installation Source /usr/local/lib/ruby/gems/2.6.0/bin/fastlane
Host Mac OS X 10.14.5 (18F203)
Ruby Lib Dir ~/.rvm/rubies/ruby-2.4.9/lib
OpenSSL Version OpenSSL 1.1.1d 10 Sep 2019
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 11.3.1

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL en_US.UTF-8
LANGUAGE

fastlane files:

No Fastfile found

No Appfile found

fastlane gems

Gem Version Update-Status
fastlane 2.150.0.rc1 ✅ Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.1.0
slack-notifier 2.3.2
rouge 2.0.7
xcpretty 0.3.0
terminal-notifier 2.0.0
terminal-table 1.8.0
plist 3.5.0
multipart-post 2.0.0
word_wrap 1.0.0
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
gh_inspector 1.1.3
multi_xml 0.6.0
rubyzip 1.3.0
security 0.1.3
xcpretty-travis-formatter 1.0.0
jwt 2.1.0
uber 0.1.0
declarative 0.0.10
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.2
mini_mime 1.0.2
httpclient 2.8.3
google-api-client 0.38.0
emoji_regex 1.0.1
jmespath 1.4.0
aws-partitions 1.332.0
aws-eventstream 1.1.0
aws-sigv4 1.2.0
aws-sdk-core 3.100.0
aws-sdk-kms 1.34.1
aws-sdk-s3 1.69.1
nanaimo 0.2.6
colored2 3.1.2
claide 1.0.3
CFPropertyList 3.0.2
atomos 0.1.3
xcodeproj 1.16.0
unicode-display_width 1.7.0
public_suffix 4.0.5
addressable 2.7.0
tty-screen 0.8.0
tty-cursor 0.7.1
tty-spinner 0.9.3
babosa 1.0.3
excon 0.75.0
faraday 1.0.1
unf_ext 0.0.7.7
unf 0.1.4
domain_name 0.5.20190701
faraday_middleware 1.0.0
fastimage 2.1.7
json 2.3.0
mini_magick 4.10.1
dotenv 2.7.5
bundler 2.1.4
naturally 2.2.0
simctl 1.6.8
multi_json 1.14.1
signet 0.14.0
os 1.1.0
memoist 0.16.2
googleauth 0.13.0
digest-crc 0.5.1
google-cloud-errors 1.0.1
google-cloud-env 1.3.2
google-cloud-core 1.5.0
google-cloud-storage 1.26.2
openssl 2.0.9
io-console 0.4.6
psych 2.2.2

generated on: 2020-06-22

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 37 (15 by maintainers)

Most upvoted comments

Thanks! I’ll have a go on Monday morning.

@squallstar Still on my phone but things changed a lot. I’ll be getting documentation together next week of the mew mode/resource relationships.

I’ll link you to example or paste some code for you in about 30 minutes.

@squallstar Im just waking up for the day but I’ll take a look in about 45 minutes!

@squallstar Hey 👋 Looks like you need to pass in a few more parameters

def post_app(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil)
app = Spaceship::ConnectAPI::App.create(
  name: app_name,
  version_string: “0.1.0”,
  sku: bundle_id,
  primary_locale: “en-US”,
  bundle_id: bundle_id,
  platforms: [
    Spaceship::ConnectAPI::Platform::IOS
  ]
)

I’m hoping to have some of the updated docs end of this week or next week with new Spaceship::ConnectAPI. Docs will be my focus once we get the official release out!

Not a problem ❤️ Going to close this issue for now

Thank you very much for the quick update