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

[!] undefined method `split' for nil:NilClass (NoMethodError) #45

Open
Robotex opened this issue Nov 21, 2019 · 5 comments
Open

[!] undefined method `split' for nil:NilClass (NoMethodError) #45

Robotex opened this issue Nov 21, 2019 · 5 comments

Comments

@Robotex
Copy link

Robotex commented Nov 21, 2019

Traceback:

Traceback (most recent call last):
	31: from /Users/robotex/.rbenv/versions/2.5.3/bin/fastlane:23:in `<main>'
	30: from /Users/robotex/.rbenv/versions/2.5.3/bin/fastlane:23:in `load'
	29: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/bin/fastlane:23:in `<top (required)>'
	28: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
	27: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	26: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/commands_generator.rb:349:in `run'
	25: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	24: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	23: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	22: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	21: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	20: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	19: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	18: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	17: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	16: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	15: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	14: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	13: from Fastfile:25:in `block (2 levels) in parsing_binding'
	12: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
	11: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:146:in `trigger_action_by_name'
	10: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:204:in `try_switch_to_lane'
	 9: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	 8: from Fastfile:4281:in `block (2 levels) in parsing_binding'
	 7: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
	 6: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
	 5: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
	 4: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:227:in `chdir'
	 3: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:235:in `block in execute_action'
	 2: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
	 1: from /Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-2.136.0/fastlane/lib/fastlane/runner.rb:256:in `block (2 levels) in execute_action'
/Users/robotex/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/fastlane-plugin-versioning-0.4.2/lib/fastlane/plugin/versioning/actions/increment_build_number_in_plist.rb:9:in `run': [!] undefined method `split' for nil:NilClass (NoMethodError)

Code:

increment_build_number_in_plist(target: target, plist_build_setting_support: true)

Edit: we use a incremental integer as build number, maybe the plugin doesn't support it?

@jdouglas-nz
Copy link
Collaborator

interesting.. I swear there are tests covering pure ints as build numbers. let me have a look

@jdouglas-nz
Copy link
Collaborator

I reckon there is some interesting things to do with specifying a target.
the closest test looks like this one.

    it "should increment number to xcodeproj if the value is non literal with plist_build_setting_support: true" do
      result = Fastlane::FastFile.new.parse("lane :test do
        increment_build_number_in_plist(plist_build_setting_support: true)
      end").runner.execute(:test)

      expect(current_xcodeproj_build_number).to eq("2")
      expect(Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::BUILD_NUMBER]).to eq("2")
    end

@jdouglas-nz
Copy link
Collaborator

@Robotex -
looking at your stack trace - it points to this line:
build_array = current_build_number.split(".").map(&:to_i)
To me, that looks like it would cover it..

Is it just a single digit, i.e. 1000 / 1 or something like 1.2.3 ?
If it's something else, please respond back with a couple examples

@simonbromberg
Copy link

simonbromberg commented Nov 18, 2020

Also having this issue. I was able to get the current build number with get_build_number_from_xcodeproj(…) and it is giving me a simple number like I expect (e.g. 2) but when I do increment_build_number_in_xcodeproj it seems (based on the error) that the value it's getting is nil somehow? I am guessing it's trying to get the build number from one of the targets and it can't find it, though I'm not sure which target is the problem. Does it ignore test targets?

Or it just isn't returning anything from get_first_build_number_in_xcodeproj.

In any case, it should probably fail more gracefully rather than crash trying to split a nil value.

@Tulean
Copy link

Tulean commented Oct 10, 2023

Do we have any solution for this? Trying to use increment_version_number_in_plist(plist_build_setting_support: true) and it is still giving me this error, even after manually updating in xcode UI version # and build #.

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

No branches or pull requests

4 participants