fastlane: Modifing project file with Xcodeproj makes gym not able to find the project file

New Issue Checklist

Issue Description

I’m changing some things in the Xcode project before building (see Fastfile excerpt below), and after I save the project, gym is unable to find the project, as if the current path changed. However, it didn’t change, as confirmed with Dir.pwd before and after the project.save command.

If I set the project file manually, the error is

/Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/lib/fastlane/runner.rb:59:in `chdir': [!] No such file or directory @ dir_chdir - ./fastlane/ (Errno::ENOENT)
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/lib/fastlane/runner.rb:59:in `rescue in execute'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/lib/fastlane/runner.rb:44:in `execute'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/lib/fastlane/lane_manager.rb:46:in `cruise_lane'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/lib/fastlane/command_line_handler.rb:30:in `handle'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/lib/fastlane/commands_generator.rb:49:in `block (2 levels) in run'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane_core-0.52.0/lib/fastlane_core/ui/fastlane_runner.rb:36:in `run!'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/lib/fastlane/commands_generator.rb:246:in `run'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/lib/fastlane/commands_generator.rb:20:in `start'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/lib/fastlane/cli_tools_distributor.rb:58:in `take_off'
    from /Users/gcamp/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fastlane-1.104.0/bin/fastlane:5:in `<top (required)>'
    from /Users/gcamp/.rbenv/versions/2.2.3/bin/fastlane:23:in `load'
    from /Users/gcamp/.rbenv/versions/2.2.3/bin/fastlane:23:in `<main>'

Configuration Files

Fastfile:

def update_transit_target
    require 'xcodeproj'

    project = Xcodeproj::Project.open("../#{XCODE_PROJ}")
    target = project.native_targets.find {|s| s.name == "TransitBeta" }

    yield(target)

    project.save

    gym
end

Environment

fastlane version (run fastlane -v): fastlane 1.104.0

Do you use bundler to execute fastlane (i.e. bundle exec fastlane)? No

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? rbenv

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

@gcamp they’ve released a new version of xcodeproj which fixed a similar issue for me. It is in 1.3.2: https://github.com/CocoaPods/Xcodeproj/releases/tag/1.3.2

@TKBurner I was seeing this issue running fastlane from both my project folder and fastlane folder. The latest release of fastlane(v1.105.0) seems to have fixed the problem for me though.

@TKBurner I usually use fastlane from my project folder but the same problem is happening when running from the fastlane project. 1.105.0 didn’t fixed it for me.

FYI I tried to see if Dir.pwd was changing and it doesn’t. Also tried to change manually the current directory and it didn’t work.

Problem happens when I run either remove_watch_from_project or remove_widget_from_project