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 Error #12

Closed
CaptainScavo opened this issue May 19, 2017 · 13 comments
Closed

Undefined Method Error #12

CaptainScavo opened this issue May 19, 2017 · 13 comments
Labels

Comments

@CaptainScavo
Copy link

New to Fastlane and Ruby, so apologies if I have done something stupid to cause my error.

I have the following in my fastfile:

      update_settings_bundle(
        xcodeproj: "appdemo.xcodeproj",
        key: "pref_env",
        value: "QA"
      )

When I run my fastfile, I get the following error:
undefined method []' for nil:NilClass`

Root.plist is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>StringsTable</key>
	<string>Root</string>
	<key>PreferenceSpecifiers</key>
	<array>
		<dict>
			<key>Type</key>
			<string>PSTitleValueSpecifier</string>
			<key>Title</key>
			<string>Version</string>
			<key>Key</key>
			<string>pref_version</string>
			<key>DefaultValue</key>
			<string>?????????</string>
		</dict>
		<dict>
			<key>Type</key>
			<string>PSTitleValueSpecifier</string>
			<key>Title</key>
			<string>Environment</string>
			<key>Key</key>
			<string>pref_env</string>
			<key>DefaultValue</key>
			<string>?????????</string>
		</dict>
	</array>
</dict>
</plist>
@jdee
Copy link
Owner

jdee commented May 20, 2017

Hi @CaptainScavo. Thanks for using the plugin.

I'm not sure why that would be. Some things that come to mind:

Is your project in the same directory as the Gemfile? You might need to specify a subdirectory.
I think that error is more explicit though.

You could try using some of the other options to the action like :target, :configuration, :file, e.g.:

update_settings_bundle(
  xcodeproj: "appdemo.xcodeproj",
  key: "pref_env",
  value: "QA",
  target: "appdemo",
  configuration: "Release",
  file: "Root.plist"
)

And then if that fixes it remove them one by one to figure out which one is needed. Or keep them all explicit if you like.

Is your settings bundle called Settings.bundle? See #10. For now, other names are not supported, and supporting them requires additional changes to the commit_version_bump action in Fastlane proper.

Scanning through the code, I don't see anywhere that the subscript operator is used where a nil check is not performed beforehand with an explanatory error. That exception may be raised somewhere in a dependency.

If none of the above helps figure out the problem, I can help you install from the master branch here and give you some changes with more debugging to dump out more information, like a stack trace.

@CaptainScavo
Copy link
Author

Is your project in the same directory as the Gemfile?

Looks like the settings bundle plugin get installed to:
/Library/Ruby/Gems/2.0.0/gems/fastlane-plugin-settings_bundle-1.1.1/lib/fastlane/plugin

and my fastfile is in ~/Documents/projects/appdemo/fastlane

You could try using some of the other options to the action like :target, :configuration, :file, e.g.:

Updated the fastfile to the following:

      update_settings_bundle(
        xcodeproj: "appdemo.xcodeproj",
        key: "pref_env",
        value: "QA",
        target: "appdemo",
        configuration: "Release",
        file: "Root.plist"
      )

but I still get the same error - undefined method `[]' for nil:NilClass

Is your settings bundle called Settings.bundle?

Yes. It lives in same directory as Main.storyboard and AppDelegate.*

I can help you install from the master branch here and give you some changes with more debugging to dump out more information, like a stack trace.

That would be great.

@jdee
Copy link
Owner

jdee commented May 23, 2017

Are you using the self-contained Fastlane build installed via Homebrew/zip? Or are you running with Ruby, bundle exec, etc? I don't think the canned version works with development builds, so you'll need to use Ruby.

Modify the fastlane/Pluginfile and change the line that reads

gem "fastlane-plugin-settings_bundle"

to

gem "fastlane-plugin-settings_bundle", git: "https://github.com/jdee/settings-bundle"

Then install the version from master:

bundle install

And now run Fastlane using the Bundler

bundle exec fastlane my_lane

This adds a stack trace to the output.

Could you please post the stack trace as well as either the output of bundle show or the contents of your Gemfile.lock so that I can see the version of each dependency? That should help determine what's going on.

Updated: The version of each dependency is recorded in Gemfile.lock, not the Gemfile.

@CaptainScavo
Copy link
Author

      update_settings_bundle(
        xcodeproj: "appdemo.xcodeproj",
        key: "pref_env",
        value: "QA",
        target: "appdemo",
        configuration: "Release",
        file: "Root.plist"
      )

With settings above, I get the error below:

> bundle exec fastlane qa
/Library/Ruby/Gems/2.0.0/gems/fastimage-2.1.0/lib/fastimage.rb:67: warning: already initialized constant URI::DEFAULT_PARSER
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/common.rb:545: warning: previous definition of DEFAULT_PARSER was here
+-------------------------------+---------+------------------------+
|                           Used plugins                           |
+-------------------------------+---------+------------------------+
| Plugin                        | Version | Action                 |
+-------------------------------+---------+------------------------+
| fastlane-plugin-aws_s3        | 0.2.8   | aws_s3                 |
| fastlane-plugin-settings_bun  | 1.1.2   | update_settings_bundle |
| dle                           |         |                        |
+-------------------------------+---------+------------------------+

[14:53:14]: -------------------------------------------------
[14:53:14]: --- Step: Verifying required fastlane version ---
[14:53:14]: -------------------------------------------------
[14:53:14]: Your fastlane version 2.32.1 matches the minimum requirement of 2.31.0  ✅
[14:53:14]: ------------------------------
[14:53:14]: --- Step: default_platform ---
[14:53:14]: ------------------------------
[14:53:14]: --------------------------
[14:53:14]: --- Step: xcode_select ---
[14:53:14]: --------------------------
[14:53:14]: Setting Xcode version to /Applications/Xcode.app for all build steps
[14:53:14]: Driving the lane 'ios qa' 🚀
[14:53:14]: ------------------------------------------
[14:53:14]: --- Step: Switch to ios build_app lane ---
[14:53:14]: ------------------------------------------
[14:53:14]: Cruising over to lane 'ios build_app' 🚖
[14:53:14]: ------------------------------------
[14:53:14]: --- Step: update_settings_bundle ---
[14:53:14]: ------------------------------------
[14:53:15]: -----------------------------------
[14:53:15]: --- Step: clean_build_artifacts ---
[14:53:15]: -----------------------------------
[14:53:15]: Cleaned up build artifacts 🐙
+------------------+--------+
|       Lane Context        |
+------------------+--------+
| DEFAULT_PLATFORM | ios    |
| PLATFORM_NAME    | ios    |
| LANE_NAME        | ios qa |
+------------------+--------+
[14:53:15]: Info.plist not found for configuration Release
["/Users/dscavo/.bundle/ruby/2.0.0/settings-bundle-fc96d38e3025/lib/fastlane/plugin/settings_bundle/helper/settings_bundle_helper.rb:70:in `settings_from_project'", 
"/Users/dscavo/.bundle/ruby/2.0.0/settings-bundle-fc96d38e3025/lib/fastlane/plugin/settings_bundle/actions/update_settings_bundle_action.rb:37:in `run'", 
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:252:in `block (2 levels) in execute_action'", 
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'", 
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:230:in `block in execute_action'", 
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:226:in `chdir'", 
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:226:in `execute_action'", 
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:148:in `trigger_action_by_name'", 
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing'" "Fastfile:157:in `block in parsing_binding'",
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in `call'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in `call'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:201:in `try_switch_to_lane'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:156:in `trigger_action_by_name'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing'", "Fastfile:54:in `block (2 levels) in parsing_binding'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in `call'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in `call'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:49:in `block in execute'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:45:in `chdir'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:45:in `execute'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane_manager.rb:52:in `cruise_lane'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/command_line_handler.rb:30:in `handle'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/commands_generator.rb:104:in `block (2 levels) in run'", 
 "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:178:in `call'", 
 "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:178:in `call'", 
 "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:153:in `run'", 
 "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/runner.rb:476:in `run_active_command'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'", 
 "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/delegates.rb:15:in `run!'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/commands_generator.rb:303:in `run'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/commands_generator.rb:42:in `start'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/cli_tools_distributor.rb:66:in `take_off'", 
 "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/bin/fastlane:20:in `<top (required)>'", "/usr/local/bin/fastlane:23:in `load'", "/usr/local/bin/fastlane:23:in `<top (required)>'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `load'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `kernel_load'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:27:in `run'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli.rb:335:in `exec'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli.rb:20:in `dispatch'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli.rb:11:in `start'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/exe/bundle:32:in `block in <top (required)>'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'", 
 "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/exe/bundle:24:in `<top (required)>'", "/usr/local/bin/bundle:23:in `load'", "/usr/local/bin/bundle:23:in `<main>'"]

+------+------------------------------+-------------+
|                 fastlane summary                  |
+------+------------------------------+-------------+
| Step | Action                       | Time (in s) |
+------+------------------------------+-------------+
| 1    | Verifying required fastlane  | 0           |
|      | version                      |             |
| 2    | default_platform             | 0           |
| 3    | xcode_select                 | 0           |
| 4    | Switch to ios build_app lane | 0           |
| 💥   | update_settings_bundle       | 0           |
| 6    | clean_build_artifacts        | 0           |
+------+------------------------------+-------------+

[14:53:15]: fastlane finished with errors

[!] Info.plist not found for configuration Release
["/Users/dscavo/.bundle/ruby/2.0.0/settings-bundle-fc96d38e3025/lib/fastlane/plugin/settings_bundle/helper/settings_bundle_helper.rb:70:in `settings_from_project'", "/Users/dscavo/.bundle/ruby/2.0.0/settings-bundle-fc96d38e3025/lib/fastlane/plugin/settings_bundle/actions/update_settings_bundle_action.rb:37:in `run'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:252:in `block (2 levels) in execute_action'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:230:in `block in execute_action'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:226:in `chdir'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:226:in `execute_action'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:148:in `trigger_action_by_name'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing'", "Fastfile:157:in `block in parsing_binding'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in `call'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in `call'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:201:in `try_switch_to_lane'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:156:in `trigger_action_by_name'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing'", "Fastfile:54:in `block (2 levels) in parsing_binding'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in `call'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in `call'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:49:in `block in execute'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:45:in `chdir'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:45:in `execute'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane_manager.rb:52:in `cruise_lane'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/command_line_handler.rb:30:in `handle'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/commands_generator.rb:104:in `block (2 levels) in run'", "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:178:in `call'", "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:178:in `call'", "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:153:in `run'", "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/runner.rb:476:in `run_active_command'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'", "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/delegates.rb:15:in `run!'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/commands_generator.rb:303:in `run'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/commands_generator.rb:42:in `start'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/cli_tools_distributor.rb:66:in `take_off'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/bin/fastlane:20:in `<top (required)>'", "/usr/local/bin/fastlane:23:in `load'", "/usr/local/bin/fastlane:23:in `<top (required)>'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `load'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `kernel_load'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:27:in `run'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli.rb:335:in `exec'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli.rb:20:in `dispatch'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli.rb:11:in `start'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/exe/bundle:32:in `block in <top (required)>'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/exe/bundle:24:in `<top (required)>'", "/usr/local/bin/bundle:23:in `load'", "/usr/local/bin/bundle:23:in `<main>'"]
      update_settings_bundle(
        xcodeproj: "appdemo.xcodeproj",
        key: "pref_env",
        value: "QA",
        target: "appdemo",
        configuration: "qa",
        file: "Root.plist"
      )

If I update the configuration variable to match the config name used in my xcode project, I get the undefined method (ie original) error:

bundle exec fastlane qa
/Library/Ruby/Gems/2.0.0/gems/fastimage-2.1.0/lib/fastimage.rb:67: warning: already initialized constant URI::DEFAULT_PARSER
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/uri/common.rb:545: warning: previous definition of DEFAULT_PARSER was here
+-------------------------------+---------+------------------------+
| Used plugins |
+-------------------------------+---------+------------------------+
| Plugin | Version | Action |
+-------------------------------+---------+------------------------+
| fastlane-plugin-aws_s3 | 0.2.8 | aws_s3 |
| fastlane-plugin-settings_bun | 1.1.2 | update_settings_bundle |
| dle | | |
+-------------------------------+---------+------------------------+

15:02:49: --- Step: Verifying required fastlane version ---
15:02:49: -------------------------------------------------
15:02:49: Your fastlane version 2.32.1 matches the minimum requirement of 2.31.0 ✅
15:02:49: ------------------------------
15:02:49: --- Step: default_platform ---
15:02:49: ------------------------------
15:02:49: --------------------------
15:02:49: --- Step: xcode_select ---
15:02:49: --------------------------
15:02:49: Setting Xcode version to /Applications/Xcode.app for all build steps
15:02:49: Driving the lane 'ios qa' 🚀
15:02:49: ------------------------------------------
15:02:49: --- Step: Switch to ios build_app lane ---
15:02:49: ------------------------------------------
15:02:49: Cruising over to lane 'ios build_app' 🚖
15:02:49: ------------------------------------
15:02:49: --- Step: update_settings_bundle ---
15:02:49: ------------------------------------
15:02:49: -----------------------------------
15:02:49: --- Step: clean_build_artifacts ---
15:02:49: -----------------------------------
15:02:49: Cleaned up build artifacts 🐙
+------------------+--------+
| Lane Context |
+------------------+--------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios qa |
+------------------+--------+
15:02:49: undefined method []' for nil:NilClass ["/Users/dscavo/.bundle/ruby/2.0.0/settings-bundle-fc96d38e3025/lib/fastlane/plugin/settings_bundle/helper/settings_bundle_helper.rb:111:in update_settings_plist_title_setting'",
"/Users/dscavo/.bundle/ruby/2.0.0/settings-bundle-fc96d38e3025/lib/fastlane/plugin/settings_bundle/actions/update_settings_bundle_action.rb:42:in run'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:252:in block (2 levels) in execute_action'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/actions/actions_helper.rb:50:in execute_action'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:230:in block in execute_action'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:226:in chdir'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:226:in execute_action'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:148:in trigger_action_by_name'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/fast_file.rb:146:in method_missing'", "Fastfile:157:in block in parsing_binding'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in call'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in call'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:201:in try_switch_to_lane'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:156:in trigger_action_by_name'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/fast_file.rb:146:in method_missing'", "Fastfile:54:in block (2 levels) in parsing_binding'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in call'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane.rb:33:in call'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:49:in block in execute'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:45:in chdir'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/runner.rb:45:in execute'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/lane_manager.rb:52:in cruise_lane'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/command_line_handler.rb:30:in handle'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/commands_generator.rb:104:in block (2 levels) in run'", "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:178:in call'",
"/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:178:in call'", "/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:153:in run'",
"/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/runner.rb:476:in run_active_command'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:38:in run!'",
"/Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/delegates.rb:15:in run!'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/commands_generator.rb:303:in run'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/commands_generator.rb:42:in start'", "/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/fastlane/lib/fastlane/cli_tools_distributor.rb:66:in take_off'",
"/Library/Ruby/Gems/2.0.0/gems/fastlane-2.32.1/bin/fastlane:20:in <top (required)>'", "/usr/local/bin/fastlane:23:in load'", "/usr/local/bin/fastlane:23:in <top (required)>'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in load'",
"/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in kernel_load'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:27:in run'",
"/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli.rb:335:in exec'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run'",
"/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor.rb:359:in dispatch'",
"/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli.rb:20:in dispatch'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in start'",
"/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/cli.rb:11:in start'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/exe/bundle:32:in block in <top (required)>'",
"/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/friendly_errors.rb:121:in with_friendly_errors'", "/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/exe/bundle:24:in <top (required)>'", "/usr/local/bin/bundle:23:in load'", "/usr/local/bin/bundle:23:in

'"]

+------+------------------------------+-------------+
| fastlane summary |
+------+------------------------------+-------------+
| Step | Action | Time (in s) |
+------+------------------------------+-------------+
| 1 | Verifying required fastlane | 0 |
| | version | |
| 2 | default_platform | 0 |
| 3 | xcode_select | 0 |
| 4 | Switch to ios build_app lane | 0 |
| 💥 | update_settings_bundle | 0 |
| 6 | clean_build_artifacts | 0 |
+------+------------------------------+-------------+

[15:02:50]: fastlane finished with errors


bundle show
Gems included by the bundle:

  • CFPropertyList (2.3.5)
  • addressable (2.5.1)
  • apktools (0.7.2)
  • aws-sdk (2.9.21)
  • aws-sdk-core (2.9.21)
  • aws-sdk-resources (2.9.21)
  • aws-sigv4 (1.0.0)
  • babosa (1.0.2)
  • bundler (1.14.6)
  • claide (1.0.1)
  • colored (1.2)
  • colored2 (3.1.2)
  • commander-fastlane (4.4.4)
  • domain_name (0.5.20170404)
  • dotenv (2.2.1)
  • excon (0.55.0)
  • faraday (0.12.1)
  • faraday-cookie_jar (0.0.6)
  • faraday_middleware (0.11.0.1)
  • fastimage (2.1.0)
  • fastlane (2.32.1)
  • fastlane-plugin-aws_s3 (0.2.8)
  • fastlane-plugin-settings_bundle (1.1.2 fc96d38)
  • gh_inspector (1.0.3)
  • google-api-client (0.9.28)
  • googleauth (0.5.1)
  • highline (1.7.8)
  • http-cookie (1.0.3)
  • httpclient (2.8.3)
  • hurley (0.2)
  • jmespath (1.3.1)
  • json (2.1.0)
  • jwt (1.5.6)
  • little-plugger (1.1.4)
  • logging (2.2.2)
  • memoist (0.15.0)
  • mime-types (3.1)
  • mime-types-data (3.2016.0521)
  • mini_magick (4.5.1)
  • multi_json (1.12.1)
  • multi_xml (0.6.0)
  • multipart-post (2.0.0)
  • nanaimo (0.2.3)
  • os (0.9.6)
  • plist (3.3.0)
  • public_suffix (2.0.5)
  • representable (2.3.0)
  • retriable (2.1.0)
  • rouge (2.0.7)
  • rubyzip (1.2.1)
  • security (0.1.3)
  • signet (0.7.3)
  • slack-notifier (1.5.1)
  • terminal-notifier (1.8.0)
  • terminal-table (1.8.0)
  • tty-screen (0.5.0)
  • uber (0.0.15)
  • unf (0.1.4)
  • unf_ext (0.0.7.4)
  • unicode-display_width (1.2.1)
  • word_wrap (1.0.0)
  • xcodeproj (1.4.4)
  • xcpretty (0.2.8)
  • xcpretty-travis-formatter (0.0.4)

@jdee jdee added the bug label May 23, 2017
@jdee
Copy link
Owner

jdee commented May 23, 2017

You'll need to add the :configuration option if you don't have a valid Release configuration.

The original error occurs because of a bad assumption, that Plist.parse_xml raises. It actually returns nil if the file is not found, e.g. The unhandled nil return is the problem. It may be that it is not finding the file, or it may be that it's failing to parse it. But the file you posted looked fine.

There's one more new commit in master that will give you a bit more descriptive error in that case. In particular, it will tell you the path of the file it's failing to open. You can double-check that path and see if it's correct. If it's not, you can probably just use the :file option. For example, if you don't have the Root.plist at the top of the Settings.bundle but rather in Settings.bundle/subdir/Root.plist, you can supply a file: "subdir/Root.plist" option.

I'd like to get more error reporting out of the plist gem and distinguish parsing failures from filesystem errors. At some point soon, I'll release an update with better error reporting. For now, maybe you can get around the problem.

@CaptainScavo
Copy link
Author

CaptainScavo commented May 24, 2017

So I updated to the newest version.

That gives me the error:
[!] Failed to open settings plist file /Users/dscavo/Documents/projects/appdemo/Settings.bundle/Root.plist

However, the Settings.bundle file is actually located at:
/Users/dscavo/Documents/projects/appdemo/appdemo/Settings.bundle/Root.plist

When I use the :file option, it inserts the path AFTER Settings.bundle part.
So I need a way to specify additional paths BEFORE the Settings.bundle part. I am using a standard Xcode project layout, so I am not sure why I am having such trouble with this ???

But really appreciate your responsiveness, and the updates you made to the README on Github are really good.

@jdee
Copy link
Owner

jdee commented May 24, 2017

You're having trouble because of a bug in the plugin. I'm still not sure what it is though. If you don't mind, I've added one more commit with diagnostics that should point to what the problem is. I also made a small change to how the path is built from components, though I'm not sure if it makes any difference here. But there's a small chance this will just work. Anyway, thanks for the patience and feedback.

Now you should see something like:

[09:38:25]: ------------------------------------
[09:38:25]: --- Step: update_settings_bundle ---
[09:38:25]: ------------------------------------
[09:38:25]: Looking for settings plist file...
[09:38:25]:  project.path = /Users/jdee/github/jdee/settings-bundle/examples/TempExample/TempExample.xcodeproj
[09:38:25]:  project_parent = /Users/jdee/github/jdee/settings-bundle/examples/TempExample
[09:38:25]:  settings_bundle_path = TempExample/Settings.bundle
[09:38:25]:  file = Root.plist
[09:38:25]: Opening /Users/jdee/github/jdee/settings-bundle/examples/TempExample/TempExample/Settings.bundle/Root.plist...
[09:38:25]: Success

That is output from a project structured somewhat like yours. The settings_bundle_path is taken from the project's file list. The path used is, essentially, project_parent/settings_bundle_path/file. The latest change will also respect relative file paths like ../AnotherFolder/Settings.bundle, though if that were the problem, the . or .. would have shown up in your last output.

If there is no easy way to fix this inference, I can also add something like a :settings_bundle_path option so that you can override it.

Whatever the problem/solution is, there's also a good chance that the commit_version_bump action will fail for similar reasons. The code there uses the same methodology: https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/commit_version_bump.rb#L215. If that fails, there will have to be a Fastlane patch. I patched that action when this plugin was released, and whatever solution is arrived at here can easily be submitted to Fastlane as well.

@CaptainScavo
Copy link
Author

Here is the additional output:

[15:55:10]: ------------------------------------
[15:55:10]: --- Step: update_settings_bundle ---
[15:55:10]: ------------------------------------
[15:55:10]: Looking for settings plist file...
[15:55:10]:  project.path = /Users/dscavo/Documents/projects/appdemo/appdemo.xcodeproj
[15:55:10]:  project_parent = /Users/dscavo/Documents/projects/appdemo
[15:55:10]:  settings_bundle_path = Settings.bundle
[15:55:10]:  file = Root.plist
[15:55:10]: Opening /Users/dscavo/Documents/projects/appdemo/Settings.bundle/Root.plist...

And then later:
No such file or directory - /Users/dscavo/Documents/projects/appdemo/Settings.bundle/Root.plist

@jdee
Copy link
Owner

jdee commented May 24, 2017

@CaptainScavo I know what the problem is now. I duplicated the error by putting the Settings.bundle in a group. The path reported there is relative to the group. I should be able to get you a fix in the next day or so. However, I'm sure that commit_version_bump will not work well with this setup. Until that can all be taken care of, you could work around this by moving your Settings.bundle out of the appdemo group and into the project root. This doesn't require moving the Settings.bundle directory, just moving it in Xcode. Then commit_version_bump should work too.

Fails:
screen shot 2017-05-24 at 3 46 28 pm

Succeeds:
screen shot 2017-05-24 at 3 46 33 pm

@jdee
Copy link
Owner

jdee commented May 25, 2017

@CaptainScavo What's in the master branch should now work with your project without moving the Settings.bundle. As indicated, commit_version_bump will probably still fail.

I'll release this soon and submit changes to Fastlane as well.

@CaptainScavo
Copy link
Author

1.2 version works great.

Thanks for the diagnostics and new version !!!!

@jdee
Copy link
Owner

jdee commented Jun 10, 2017

@CaptainScavo This PR has been submitted to Fastlane to fix commit_version_bump. For now, you can use my fork by adding this to your Gemfile:

gem "fastlane", git: "https://github.com/jdee/fastlane", branch: "commit-version-bump-bug"

See the updated example Fastfile in this repo for new usage. You can get rid of the :settings option to the commit_version_bump action.

@jdee
Copy link
Owner

jdee commented Jun 15, 2017

The fix for commit_version_bump was released in Fastlane 2.39.0. That does not include any syntax changes. It just corrects the inference of the settings bundle location when using the :settings option. The fix for this bug was also released in version 1.2.0 of the settings-bundle plugin. Settings bundles in groups should now work fine if you update to the latest version.

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

No branches or pull requests

2 participants