Xcodeproj: SystemStackError after MacOS & Xcode upgrade

Hi,

today I suddenly got the following error message when running fastlane in the gym part. Only changed MacOS to HighSierra and use XCode 9 now.

/Users/danny/.rvm/gems/ruby-2.4.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project/object/build_configuration.rb:135:in `match_variable': stack level too deep (SystemStackError)
	from /Users/danny/.rvm/gems/ruby-2.4.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project/object/build_configuration.rb:122:in `resolve_variable_substitution'
	from /Users/danny/.rvm/gems/ruby-2.4.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project/object/build_configuration.rb:87:in `resolve_build_setting'
	from /Users/danny/.rvm/gems/ruby-2.4.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project/object/build_configuration.rb:128:in `resolve_variable_substitution'
	from /Users/danny/.rvm/gems/ruby-2.4.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project/object/build_configuration.rb:131:in `resolve_variable_substitution'
	from /Users/danny/.rvm/gems/ruby-2.4.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project/object/build_configuration.rb:87:in `resolve_build_setting'
	from /Users/danny/.rvm/gems/ruby-2.4.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project/object/build_configuration.rb:128:in `resolve_variable_substitution'
	from /Users/danny/.rvm/gems/ruby-2.4.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project/object/build_configuration.rb:131:in `resolve_variable_substitution'
	from /Users/danny/.rvm/gems/ruby-2.4.2/gems/xcodeproj-1.5.2/lib/xcodeproj/project/object/build_configuration.rb:87:in `resolve_build_setting'
	 ... 8929 levels...
	from /Users/danny/.rvm/gems/ruby-2.4.2/bin/fastlane:23:in `load'
	from /Users/danny/.rvm/gems/ruby-2.4.2/bin/fastlane:23:in `<main>'
	from /Users/danny/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `eval'
	from /Users/danny/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `<main>'

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 22 (9 by maintainers)

Most upvoted comments

@blender thanks a lot for the information!. I think I have an idea of what’s the problem here. Nowadays CFBundleIdentifier is defined as $(PRODUCT_BUNDLE_IDENTIFIER) in the App’s Info.plist and fastlane is querying for that, but some projects might still use the old style (setting the value directly in the Info.plist) and don’t actually have a $(PRODUCT_BUNDLE_IDENTIFIER) build setting.

In any case, Xcodeproj shouldn’t crash trying to resolve a build setting that isn’t defined in the project.

I’ll try to reproduce this today and create a branch you can try later.

@Ruenzuo Finished: SUCCESS 🎉

I see. I is overwritten by the xcconfig. When I set PRODUCT_BUNDLE_IDENTIFIER to a fixed value it works. Thank you for your help!

We use fastlane’s https://docs.fastlane.tools/actions/update_app_identifier/#update_app_identifier

In the project:

  • bundle identifier is a static string com.mycompany.realgreen not a variable ( when updating the identifier we change it to com.mycompany.realgreen.internal)
  • there is no extra xconfig
  • there are 5 targets (1 ios, 4 watchOS). iOS target is Real Green, watchOS targets are all named “Real Watch”, “Real Watch (Complication)” and so on
  • project format is for some reason Xcode3.2 compatible (I’m getting suspicious here)

Relevant fastlane code:

update_app_identifier(
    plist_path: "Real Green/Info.plist", # Path to info plist file, relative to xcodeproj
    app_identifier: app_id # The App Identifier
  )

update_info_plist(
      plist_path: "Real Watch Extension/Info.plist",
      block: lambda { |plist|
        plist['NSExtension']['NSExtensionAttributes']['WKAppBundleIdentifier'] = parent_app_id
      }
    )

Edit: I see you are in Berlin. I can show you the problem in person.

Same here, xcodeproj 1.5.1 works fine. Maybe a git bisect can help identifying the change that causes the problem?

Coming here from https://github.com/fastlane/fastlane/issues/10500#issuecomment-338161113.

Using gem 'xcodeproj', '1.5.1' worked for me.