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

Closed
pellet opened this Issue Nov 23, 2016 · 43 comments

Projects

None yet

9 participants

@pellet
pellet commented Nov 23, 2016

Issue Description

Issue occurs when no run target is set for scheme(only using the scheme for running tests).
Workaround was to set a run target(test host in my case).

Complete output when running fastlane, including the stack trace and command used
scan
fastlane_core-0.57.0/lib/fastlane_core/project.rb:188:in `supported_platforms': [!] undefined method `split' for nil:NilClass (NoMethodError)
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/fastlane_core-0.57.0/lib/fastlane_core/project.rb:184:in `ios?'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/scan-0.14.2/lib/scan/detect_values.rb:28:in `set_additional_default_values'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/scan-0.14.2/lib/scan.rb:27:in `config='
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/scan-0.14.2/lib/scan/manager.rb:4:in `work'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/scan-0.14.2/lib/scan/commands_generator.rb:41:in `block (2 levels) in run'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/fastlane_core-0.57.0/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/scan-0.14.2/lib/scan/commands_generator.rb:60:in `run'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/scan-0.14.2/lib/scan/commands_generator.rb:14:in `start'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/gems/scan-0.14.2/bin/scan:6:in `<top (required)>'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/bin/scan:23:in `load'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/bin/scan:23:in `<main>'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
	from /Users/belmoj/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'

Environment

I have scan and gym installed as separate gems, without 'fastlane' installed.

@fastlane-bot

It seems like you have not included the output of fastlane env.

To make it easier for us help you resolve this issue, please update the issue to include the output of fastlane env ๐Ÿ‘

@hjanuschka
Member

which version of xcode do you use? seems to be SUPPORTED_PLATFORMS is not set in the project.

can you run

xcodebuild -showBuildSettings -scheme app -project path/to/your/app.xcodeproj

and check if "supported_platforms" is set. i think this is intrudoced by this PR: #6925

@0xced can you help here?

@sogko
Contributor
sogko commented Nov 23, 2016 edited

Just updated fastlane to v1.110.0

Same error from gym:

.../fastlane_core-0.57.0/lib/fastlane_core/project.rb:188:in `supported_platforms': [!] undefined method `split' for nil:NilClass (NoMethodError)
xcodebuild -showBuildSettings -scheme app -project path/to/your/app.xcodeproj

Output: (truncated)
....
    SUPPORTED_PLATFORMS = iphonesimulator phones

....
@hjanuschka
Member

@sogko can you share the output of fastlane env

@sogko
Contributor
sogko commented Nov 23, 2016 edited
๐Ÿšซ fastlane environment ๐Ÿšซ

Stack

Key Value
OS 10.11.6
Ruby 2.1.1
Bundler? true
Git git version 2.10.0
Installation Source /Users/hafiz/.rvm/gems/ruby-2.1.1/bin/fastlane
Host Mac OS X 10.11.6 (15G1108)
Ruby Lib Dir /Users/hafiz/.rvm/rubies/ruby-2.1.1/lib
OpenSSL Version OpenSSL 1.0.1g 7 Apr 2014
Is contained false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 8.0

System Locale

Error
No Locale with UTF8 found ๐Ÿšซ

fastlane files:

`./fastlane/Fastfile`
fastlane_version "1.107.0"

default_platform :ios

platform :ios do
  desc "Build"
  lane :build do
    match(
        force: ENV["S_MATCH_FORCE"] == "true",
        type: "development",
        app_identifier: ENV["S_BUNDLE_IDENTIFIER"]
    )
    gym
  end

end
`./fastlane/Appfile`
# REDACTED
`./fastlane/Gymfile`
scheme "app"

project "ios/app.xcodeproj"

codesigning_identity "iPhone Developer"

output_directory "./"

clean true

# build fail using the newer api
use_legacy_build_api true

xcargs [
  "USERSETTINGS1='#{ENV["USERSETTINGS1"]}'",
].join(" ")

fastlane gems

Gem Version Update-Status
credentials_manager 0.16.2 โœ… Up-To-Date
fastlane_core 0.57.0 โœ… Up-To-Date
spaceship 0.37.0 โœ… Up-To-Date
cert 1.4.4 โœ… Up-To-Date
deliver 1.15.1 โœ… Up-To-Date
frameit 3.0.0 โœ… Up-To-Date
gym 1.12.1 โœ… Up-To-Date
sigh 1.11.2 โœ… Up-To-Date
match 0.11.0 โœ… Up-To-Date
pem 1.4.0 โœ… Up-To-Date
pilot 1.12.1 โœ… Up-To-Date
produce 1.3.0 โœ… Up-To-Date
scan 0.14.2 โœ… Up-To-Date
screengrab 0.5.6 โœ… Up-To-Date
snapshot 1.16.4 โœ… Up-To-Date
supply 0.7.1 โœ… Up-To-Date
fastlane 1.110.0 โœ… Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
executable-hooks 1.3.1
bundler-unload 1.0.2
rubygems-bundler 1.4.3
bundler 1.13.6
CFPropertyList 2.3.3
i18n 0.7.0
json 1.8.3
minitest 5.9.1
thread_safe 0.3.5
tzinfo 1.2.2
activesupport 4.2.7.1
public_suffix 2.0.4
addressable 2.5.0
babosa 1.0.2
colored 1.2
highline 1.7.8
commander 4.4.0
security 0.1.3
credentials_manager 0.16.2
excon 0.54.0
gh_inspector 1.0.2
multi_json 1.12.1
plist 3.2.0
rubyzip 1.1.7
terminal-table 1.4.5
fastlane_core 0.57.0
multipart-post 2.0.0
faraday 0.10.0
unf_ext 0.0.7.2
unf 0.1.4
domain_name 0.5.20161021
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
faraday_middleware 0.10.1
fastimage 1.6.8
multi_xml 0.5.5
claide 1.0.1
dotenv 2.1.1
mini_magick 4.5.1
rouge 1.11.1
xcpretty 0.2.4
net-ssh 3.2.0
net-sftp 2.1.2
krausefx-shenzhen 0.14.11
slack-notifier 1.5.1
xcpretty-travis-formatter 0.0.4
jwt 1.5.6
little-plugger 1.1.4
logging 2.1.0
memoist 0.15.0
os 0.9.6
signet 0.7.3
googleauth 0.5.1
httpclient 2.8.2.4
hurley 0.2
mime-types-data 3.2016.0521
mime-types 3.1
uber 0.0.15
representable 2.3.0
retriable 2.1.0
google-api-client 0.9.20
terminal-notifier 1.7.1
word_wrap 1.0.0
xcode-install 2.0.9
nanaimo 0.2.2
xcodeproj 1.4.1

generated on: 2016-11-23

Note: @hjanuschka I've redacted the Fastfile and AppFile contents.

@hjanuschka
Member

@sogko thx for helping! its ok to skip the fastfile, but could you copy (and redact if needed) the gym call?

@hjanuschka
Member

@sogko ahhh and have you tried upgrading xcode to 8.1? if this fixes the problem - we atleast could fix it so that 8.0 users don't crash ;)

@sogko
Contributor
sogko commented Nov 23, 2016

@hjanuschka I've updated the Fastfile (and added my Gymfile, fastlane env didn't pick that up)

Re: Upgrading to 8.1, I can give that a try. ๐Ÿ‘
Maybe @pellet can you verify your Xcode build and see if upgrading to 8.1 works?

I'm thinking of trying a few other things first (basically def build_settings() failed to pick up SUPPORTED_PLATFORMS key, which has "iphonesimulator", "iphoneos" value).

Cheers!

@sogko
Contributor
sogko commented Nov 23, 2016 edited

Hey guys,

It turns out ruby def build_settings() crashed silently when the output from build_xcodebuild_showbuildsettings_command command returns an empty line before finding a line with a key its looking for.

It fails at project.rb#L243

# `c.split(" = ").first.strip` throws an exception when ` c.split(" = ").first` is nil/empty
result = @build_settings.split("\n").find { |c| c.split(" = ").first.strip == key }

Basically the fix needs to ensure that .find method has to check for nil string first before strip.

Below is the sample output from running showbuildsettings command that crashed for me.
(It stopped searched for SUPPORTED_PLATFORMS after TOOLCHAINS key.)

Build settings from command line:
    TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault

Build settings for action clean and target app:
    ACTION = clean
    SUPPORTED_DEVICE_FAMILIES = 1,2
    SUPPORTED_PLATFORMS = iphonesimulator iphoneos
    variant = normal

Build settings for action clean and target appTest:
    ACTION = clean'
    SUPPORTED_DEVICE_FAMILIES = 1,2
    SUPPORTED_PLATFORMS = iphonesimulator iphoneos
    variant = normal

Hope this help someone who's going to pick up the fix.

Cheers!

@hjanuschka
Member

@sogko awesome! nice catch

so with the following i fixed it:

class DEMO
	attr_accessor :build_settings_out
	def initialize

		@build_settings_out = File.read("1.in")
	end
        def build_settings(key: nil, optional: true)
		result = @build_settings_out.split("\n").find { |c| 
					sp=c.split(" = ")
					next if sp.length == 0
					sp.first.strip == key }
        	return result.split(" = ").last
	end
end


a = DEMO.new
b = a.build_settings(key: "SUPPORTED_PLATFORMS")


puts b

adding your output to 1.in

@hjanuschka
Member

doing a PR now ;)

@hjanuschka hjanuschka pushed a commit to hjanuschka/fastlane that referenced this issue Nov 23, 2016
Helmut Januschka fix #7141 5a8b0ec
@hjanuschka
Member

PR is there: #7144
can you test the PR?

@sogko
Contributor
sogko commented Nov 23, 2016

@hjanuschka Sure, give me a sec

@sogko
Contributor
sogko commented Nov 23, 2016

@hjanuschka Great, that fixed it for me!
Thanks for putting time into this, cheers! ๐Ÿป

@hjanuschka
Member

no problem - you did the solution ;) thx - can you close issue, or should we keep it until PR merge

@sogko
Contributor
sogko commented Nov 23, 2016

Oops, I can't close the issue since I didn't open it lol

@pellet Hope @hjanuschka PR fixed it for you and you can close it after verifying it it worked.

@TKBurner TKBurner closed this Nov 23, 2016
@asfalcone
Member

This has been fixed and released in fastlane_core 0.57.1

Run gem update fastlane_core to get the fix! We'll do gym and scan releases with this change next week ๐Ÿ‘

@nareshsvs nareshsvs pushed a commit to nareshsvs/fastlane that referenced this issue Nov 25, 2016
Naresh SVS Merge branch 'master_original'
* master_original: (166 commits)
  [produce] Version Bump (#7167)
  Update internal dependencies (#7163)
  Fix tool collector on ruby == 2.0.0 (#7164)
  Bump spaceship version (#7147)
  Bump fastlane_core version (#7148)
  [fastlane_core] build_settings parsing - fix #7141 (#7144)
  [fastlane] Primary language (#7084)
  Ensure that `ensure_version!` gets passed the right platform (#7121)
  Revert "[deliver] add new mac version fix" (#7137)
  Use HTTPS for root certificate in UpdateProjectProvisioningAction (#6970)
  Update the documentation to the latests changes on the way the frames are hosted (#7125)
  [deliver] add new mac version fix (#7063)
  Add reporter parameter to swiftlint action. (#7126)
  support --force on reset_simulators (#6954)
  Fixed unintended fastlane folder generation bug (#7129)
  refactor match to use keychain_path (#7076)
  fix unlock_keychain sierra (#7077)
  Fix tests in match for macOS Sierra. (#7101)
  fix voip cert (#7087)
  Even if using wildcard provisioning profile, WKBundleIdentifier is rewritten (#7110)
  ...

# Conflicts:
#	match/lib/match/runner.rb
#	match/lib/match/utils.rb
#	match/lib/match/version.rb
0ed01ed
@vincentsaluzzo

Hello,

I use fastlane_core 0.57.1 and the problem seems not really resolved :

sr/local/lib/ruby/gems/2.3.0/gems/fastlane_core-0.57.1/lib/fastlane_core/project.rb:188:in `supported_platforms': [!] undefined method `split' for nil:NilClass (NoMethodError)
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane_core-0.57.1/lib/fastlane_core/project.rb:176:in `mac?'
	from /usr/local/lib/ruby/gems/2.3.0/gems/gym-1.12.1/lib/gym/detect_values.rb:69:in `detect_platform'
	from /usr/local/lib/ruby/gems/2.3.0/gems/gym-1.12.1/lib/gym/detect_values.rb:25:in `set_additional_default_values'
@hjanuschka
Member

@vincentsaluzzo can you share fastlane env output

@vincentsaluzzo
fastlane env
[07:16:21]: Seems like launching fastlane takes a while
[07:16:21]: fastlane detected a Gemfile in this directory
[07:16:21]: however it seems like you don't use `bundle exec`
[07:16:21]: to launch fastlane faster, please use
[07:16:21]: 
[07:16:21]: $ bundle exec fastlane env
[07:16:21]: For more information, check out https://guides.cocoapods.org/using/a-gemfile.html
[07:16:26]: Generating fastlane environment output, this might take a few seconds...
<details><summary>๐Ÿšซ fastlane environment ๐Ÿšซ</summary>

### Stack

| Key                 | Value                                       |
| ------------------- | ------------------------------------------- |
| OS                  | 10.12.1                                     |
| Ruby                | 2.3.1                                       |
| Bundler?            | false                                       |
| Git                 | git version 2.10.2                          |
| Installation Source | /usr/local/bin/fastlane                     |
| Host                | Mac OS X 10.12.1 (16B2555)                  |
| Ruby Lib Dir        | /usr/local/Cellar/ruby/2.3.1_2/lib          |
| OpenSSL Version     | OpenSSL 1.0.2j  26 Sep 2016                 |
| Is contained        | false                                       |
| Xcode Path          | /Applications/Xcode.app/Contents/Developer/ |
| Xcode Version       | 8.1                                         |


### System Locale

| Variable | Value       |   |
| -------- | ----------- | - |
| LANG     | en_US.UTF-8 | โœ… |
| LC_ALL   | en_US.UTF-8 | โœ… |
| LANGUAGE | en_US.UTF-8 | โœ… |

### fastlane gems

| Gem                 | Version | Update-Status       |
| ------------------- | ------- | ------------------- |
| credentials_manager | 0.16.2  | โœ… Up-To-Date        |
| fastlane_core       | 0.57.1  | โœ… Up-To-Date        |
| spaceship           | 0.38.1  | ๐Ÿšซ Update availaible |
| deliver             | 1.16.0  | โœ… Up-To-Date        |
| frameit             | 3.0.0   | โœ… Up-To-Date        |
| pem                 | 1.4.0   | โœ… Up-To-Date        |
| cert                | 1.4.4   | โœ… Up-To-Date        |
| produce             | 1.3.1   | โœ… Up-To-Date        |
| gym                 | 1.12.1  | โœ… Up-To-Date        |
| pilot               | 1.12.1  | โœ… Up-To-Date        |
| scan                | 0.14.2  | โœ… Up-To-Date        |
| match               | 0.11.0  | โœ… Up-To-Date        |
| fastlane            | 1.109.0 | ๐Ÿšซ Update availaible |
| screengrab          | 0.5.6   | โœ… Up-To-Date        |
| supply              | 0.8.0   | โœ… Up-To-Date        |
| sigh                | 1.12.0  | โœ… Up-To-Date        |
| snapshot            | 1.16.4  | โœ… Up-To-Date        |


### Loaded fastlane plugins:

**No plugins Loaded**


<details><summary><b>Loaded gems</b></summary>

| Gem                       | Version |
| ------------------------- | ------- |
| did_you_mean              | 1.0.0   |
| highline                  | 1.7.8   |
| commander                 | 4.4.0   |
| terminal-table            | 1.4.5   |
| json                      | 1.8.3   |
| dotenv                    | 2.1.1   |
| net-ssh                   | 3.2.0   |
| net-sftp                  | 2.1.2   |
| security                  | 0.1.3   |
| krausefx-shenzhen         | 0.14.11 |
| slack-notifier            | 1.5.1   |
| rouge                     | 1.11.1  |
| xcpretty                  | 0.2.4   |
| terminal-notifier         | 1.7.1   |
| multipart-post            | 2.0.0   |
| word_wrap                 | 1.0.0   |
| multi_json                | 1.12.1  |
| colored                   | 1.2     |
| babosa                    | 1.0.2   |
| excon                     | 0.54.0  |
| rubyzip                   | 1.1.7   |
| gh_inspector              | 1.0.2   |
| credentials_manager       | 0.16.2  |
| fastlane_core             | 0.57.1  |
| bundler                   | 1.13.6  |
| multi_xml                 | 0.5.5   |
| http-cookie               | 1.0.3   |
| faraday-cookie_jar        | 0.0.6   |
| fastimage                 | 1.6.8   |
| mini_magick               | 4.5.1   |
| xcpretty-travis-formatter | 0.0.4   |
| i18n                      | 0.7.0   |
| thread_safe               | 0.3.5   |
| tzinfo                    | 1.2.2   |
| activesupport             | 4.2.7.1 |
| plist                     | 3.2.0   |
| claide                    | 1.0.1   |
| nanaimo                   | 0.2.2   |
| xcodeproj                 | 1.4.1   |
| io-console                | 0.4.5   |
| xcode-install             | 2.0.9   |
</details>


*generated on:* **2016-11-29**
</details>

I suppress the content of fastlane files, it contains some confidential informations.

@tomaskraina
tomaskraina commented Dec 5, 2016 edited

I believe I'm having the same issue. All fastlane gems up-to-date. gym fails with the following error:

[11:01:40]: -----------------
[11:01:40]: --- Step: gym ---
[11:01:40]: -----------------
[11:01:40]: $ xcodebuild -list -workspace ./MyApp.xcworkspace
2016-12-05 11:01:40.424 xcodebuild[1031:61384] [MT] DVTPlugInManager: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present
[11:01:41]: $ xcodebuild clean -showBuildSettings -workspace ./MyApp.xcworkspace -scheme MyApp\ AdHoc
2016-12-05 11:01:42.131 xcodebuild[1036:61680] [MT] DVTPlugInManager: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present
[11:01:43]: Variable Dump:
[11:01:43]: {:PLATFORM_NAME=>nil, :LANE_NAME=>"crashlytics", :BUILD_NUMBER=>"169", :VERSION_NUMBER=>"1.2", :SIGH_PROFILE_TYPE=>"ad-hoc"}
[11:01:43]: undefined method `split' for nil:NilClass

+------+-----------------------------------------------+-------------+
|                          fastlane summary                          |
+------+-----------------------------------------------+-------------+
| Step | Action                                        | Time (in s) |
+------+-----------------------------------------------+-------------+
| 1    | Verifying required fastlane version           | 0           |
| 2    | cocoapods                                     | 10          |
| 3    | match                                         | 36          |
| ๐Ÿ’ฅ    | gym                                           | 3           |
+------+-----------------------------------------------+-------------+

[11:01:43]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

โžก๏ธ  `supported_platforms': [!] undefined method `split' for nil:NilClass (NoMethodError)
   https://github.com/fastlane/fastlane/issues/7141 [closed] 20 ๐Ÿ’ฌ
   5 days ago

โžก๏ธ  pilot upload failure undefined method `builds' for nil:NilClass
   https://github.com/fastlane/fastlane/issues/6267 [closed] 9 ๐Ÿ’ฌ
   04 Oct 2016

โžก๏ธ  undefined method `split' for nil:NilClass for OS X screenshots
   https://github.com/fastlane/fastlane/issues/2751 [closed] 3 ๐Ÿ’ฌ
   22 Sep 2016

and 12 more at: https://github.com/fastlane/fastlane/search?q=undefined%20method%20%60split'%20for%20nil&type=Issues&utf8=โœ“
bundler: failed to load command: fastlane (/Users/tomkraina/.gems/bin/fastlane)
NoMethodError: [!] undefined method `split' for nil:NilClass
  /Users/tomkraina/.gems/gems/fastlane_core-0.57.2/lib/fastlane_core/project.rb:188:in `supported_platforms'
  /Users/tomkraina/.gems/gems/fastlane_core-0.57.2/lib/fastlane_core/project.rb:176:in `mac?'
  /Users/tomkraina/.gems/gems/gym-1.12.1/lib/gym/detect_values.rb:69:in `detect_platform'
  /Users/tomkraina/.gems/gems/gym-1.12.1/lib/gym/detect_values.rb:25:in `set_additional_default_values'
  /Users/tomkraina/.gems/gems/gym-1.12.1/lib/gym.rb:26:in `config='
  /Users/tomkraina/.gems/gems/gym-1.12.1/lib/gym/manager.rb:4:in `work'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/actions/gym.rb:24:in `run'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/runner.rb:202:in `block (2 levels) in execute_action'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/actions/actions_helper.rb:35:in `execute_action'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/runner.rb:187:in `block in execute_action'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/runner.rb:186:in `chdir'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/runner.rb:186:in `execute_action'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/runner.rb:112:in `trigger_action_by_name'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/fast_file.rb:146:in `method_missing'
  Fastfile:111:in `block in parsing_binding'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/lane.rb:33:in `call'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/runner.rb:49:in `block in execute'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/runner.rb:45:in `chdir'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/runner.rb:45:in `execute'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/lane_manager.rb:52:in `cruise_lane'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/command_line_handler.rb:30:in `handle'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/commands_generator.rb:95:in `block (2 levels) in run'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/command.rb:178:in `call'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/command.rb:153:in `run'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/runner.rb:444:in `run_active_command'
  /Users/tomkraina/.gems/gems/fastlane_core-0.57.2/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/delegates.rb:15:in `run!'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/commands_generator.rb:292:in `run'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/commands_generator.rb:36:in `start'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/lib/fastlane/cli_tools_distributor.rb:58:in `take_off'
  /Users/tomkraina/.gems/gems/fastlane-1.111.0/bin/fastlane:5:in `<top (required)>'
  /Users/tomkraina/.gems/bin/fastlane:23:in `load'
  /Users/tomkraina/.gems/bin/fastlane:23:in `<top (required)>'
@sogko
Contributor
sogko commented Dec 5, 2016

@vincentsaluzzo @tomaskraina

Could you guys share the output for the following command

xcodebuild -showBuildSettings -scheme app -project ./ios/app.xcodeproj
# Remember to specify the build scheme and project path

Note: The output maybe long, probably you could paste it into a gist?

Cheers!

@CurlyHeir

this issue still occurs, fastlane --version prints 1.111.0

usr/local/lib/ruby/gems/2.3.0/gems/fastlane_core-0.57.2/lib/fastlane_core/project.rb:188:in `supported_platforms': [!] undefined method `split' for nil:NilClass (NoMethodError)
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane_core-0.57.2/lib/fastlane_core/project.rb:184:in `ios?'
	from /usr/local/lib/ruby/gems/2.3.0/gems/scan-0.14.2/lib/scan/detect_values.rb:28:in `set_additional_default_values'
	from /usr/local/lib/ruby/gems/2.3.0/gems/scan-0.14.2/lib/scan.rb:27:in `config='
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/actions/scan.rb:15:in `run'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/runner.rb:202:in `block (2 levels) in execute_action'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/actions/actions_helper.rb:35:in `execute_action'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/runner.rb:187:in `block in execute_action'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/runner.rb:186:in `chdir'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/runner.rb:186:in `execute_action'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/runner.rb:112:in `trigger_action_by_name'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/fast_file.rb:146:in `method_missing'
	from Fastfile:27:in `block (2 levels) in parsing_binding'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/lane.rb:33:in `call'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/runner.rb:49:in `block in execute'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/runner.rb:45:in `chdir'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/runner.rb:45:in `execute'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/lane_manager.rb:52:in `cruise_lane'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/command_line_handler.rb:30:in `handle'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/commands_generator.rb:95:in `block (2 levels) in run'
	from /usr/local/lib/ruby/gems/2.3.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
	from /usr/local/lib/ruby/gems/2.3.0/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
	from /usr/local/lib/ruby/gems/2.3.0/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane_core-0.57.2/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
	from /usr/local/lib/ruby/gems/2.3.0/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/commands_generator.rb:292:in `run'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/commands_generator.rb:36:in `start'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/lib/fastlane/cli_tools_distributor.rb:58:in `take_off'
	from /usr/local/lib/ruby/gems/2.3.0/gems/fastlane-1.111.0/bin/fastlane:5:in `<top (required)>'
	from /usr/local/bin/fastlane:22:in `load'
	from /usr/local/bin/fastlane:22:in `<main>'
@sogko
Contributor
sogko commented Dec 5, 2016

@tomaskraina Thanks for the gist. Could you kindly share the output from fastlane env as well?

@CurlyHeir Could you share the output from both

  • fastlane env
  • xcodebuild -showBuildSettings -scheme app -project ./ios/app.xcodeproj (Specify the scheme and project path)

These might help to figure out the cause why build_settings() failed to get the key for SUPPORTED_PLATFORMS

@CurlyHeir

@sogko
https://gist.github.com/CurlyHeir/da0c995e662bc6aa4d77e1dc1500f084
btw. project is set up without cocoapods, it's just plain new project

@hjanuschka
Member

hmmm i tried both of the supplied build settings, and it worked - on my machine.
@sogko any further ideas?

@sogko
Contributor
sogko commented Dec 5, 2016

@hjanuschka Yeah both outputs from invoking xcodebuild through terminal looks good and parseable. Not sure if there are reasons that executing it within fastlane_core would give a different output.

It's too bad that build_settings() swallowed all exceptions and just returns nil by default, which is not helping with identifying the cause. If fastlane_core shows the cause that would be truly useful.

If @tomaskraina @CurlyHeir are comfortable with modifying and running a local copy of the fastlane_core gem, that would be great.

@hjanuschka
Member
hjanuschka commented Dec 5, 2016 edited

@sogko lets see if one of the issue reporter can modify the fastlane_core.

here is a short demo on how to run a PR! - the PR below has the #{ex} in output
review here: hjanuschka@44a32cb

get this script into your project folder,
https://gist.github.com/hjanuschka/3040fc6f371f46acff72a5e67f649b27

cd /path/to/your/project/
# this only has to be done once.
curl -o try_pr.sh https://gist.githubusercontent.com/hjanuschka/3040fc6f371f46acff72a5e67f649b27/raw/9600a34188949061a96f77c82505efd99ad6f5e4/try_pr.sh
chmod a+x  try_pr.sh


./try_pr.sh hjanuschka core_test fastlane your_lane

please backup everthing, review the .sh before you download it, this is unofficial unsupported

/cc @tomaskraina @CurlyHeir

i really wan't to tackle this issue!

@tomaskraina

Sure. I'll try to do it now.

@tomaskraina
tomaskraina commented Dec 6, 2016 edited

Here's the output. Any ideas what's wrong?

MB:MyApp tomkraina$ ./try_pr.sh hjanuschka core_test fastlane crashlytics
bundler is /Users/tomkraina/.rbenv/shims/bundler
bundler is /usr/local/bin/bundler
Wipe previous try
Cloning into '/tmp/pr-try-hjanuschka-core_test'...
remote: Counting objects: 2010, done.
remote: Compressing objects: 100% (1636/1636), done.
remote: Total 2010 (delta 363), reused 1084 (delta 194), pack-reused 0
Receiving objects: 100% (2010/2010), 17.90 MiB | 570.00 KiB/s, done.
Resolving deltas: 100% (363/363), done.
Checking connectivity... done.
Cloning PR: 
Running: fastlane crashlytics
launching fork
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies.....
Using rake 11.3.0
Using CFPropertyList 2.3.4
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.10.1
Using thread_safe 0.3.5
Using public_suffix 2.0.4
Using ast 2.3.0
Using babosa 1.0.2
Using builder 3.2.2
Using bundler 1.12.5
Using byebug 9.0.6
Using colored 1.2
Using highline 1.7.8
Using security 0.1.3
Using excon 0.54.0
Using gh_inspector 1.0.2
Using multi_json 1.12.1
Using plist 3.2.0
Using rubyzip 1.1.7
Using terminal-table 1.4.5
Using multipart-post 2.0.0
Using unf_ext 0.0.7.2
Using multi_xml 0.6.0
Using claide 1.0.1
Using nap 1.1.0
Using open4 1.3.4
Using coderay 1.1.1
Using docile 1.1.5
Using simplecov-html 0.10.0
Using tins 1.13.0
Using thor 0.19.4
Using safe_yaml 1.0.4
Using git 1.3.0
Using redcarpet 3.3.4
Using diff-lcs 1.2.5
Using dotenv 2.1.1
Using fakefs 0.8.1
Using mini_magick 4.5.1
Using rouge 1.11.1
Using net-ssh 3.2.0
Using slack-notifier 1.5.1
Using jwt 1.5.6
Using little-plugger 1.1.4
Using memoist 0.15.0
Using os 0.9.6
Using httpclient 2.8.2.4
Using hurley 0.2
Using mime-types 1.25.1
Using uber 0.0.15
Using retriable 2.1.0
Using terminal-notifier 1.7.1
Using word_wrap 1.0.0
Using nanaimo 0.2.3
Using method_source 0.8.2
Using powerpack 0.1.1
Using slop 3.6.0
Using rainbow 2.1.0
Using rspec-support 3.1.2
Using ruby-progressbar 1.8.1
Using unicode-display_width 1.1.1
Using yard 0.8.7.6
Using tzinfo 1.2.2
Using addressable 2.5.0
Using parser 2.3.3.1
Using cork 0.2.0
Using commander 4.4.1
Using faraday 0.10.0
Using unf 0.1.4
Using simplecov 0.12.0
Using term-ansicolor 1.3.2
Using crack 0.4.3
Using xcpretty 0.2.4
Using net-sftp 2.1.2
Using logging 2.1.0
Using rest-client 1.6.9
Using representable 2.3.0
Using pry 0.10.4
Using rspec-core 3.1.7
Using rspec-expectations 3.1.2
Using rspec-mocks 3.1.3
Using activesupport 4.2.7.1
Using fastimage 1.6.8
Using rubocop 0.44.1
Using claide-plugins 0.9.2
Using credentials_manager 0.16.2 from source at `credentials_manager`
Using faraday_middleware 0.10.1
Using faraday-http-cache 1.3.1
Using sawyer 0.8.1
Using signet 0.7.3
Using domain_name 0.5.20161129
Using coveralls 0.8.16
Using webmock 1.19.0
Using xcpretty-travis-formatter 0.0.4
Using pry-byebug 3.4.1
Using rspec_junit_formatter 0.2.3
Using rspec 3.1.0
Using xcodeproj 1.4.1
Using fastlane_core 0.57.2 from source at `fastlane_core`
Using krausefx-shenzhen 0.14.11
Using octokit 4.6.2
Using googleauth 0.5.1
Using http-cookie 1.0.3
Using gym 1.12.1 from source at `gym`
Using scan 0.14.2 from source at `scan`
Using screengrab 0.5.6 from source at `screengrab`
Using snapshot 1.16.4 from source at `snapshot`
Using danger 0.10.1
Using google-api-client 0.9.20
Using faraday-cookie_jar 0.0.6
Using supply 0.8.0 from source at `supply`
Using spaceship 0.38.4 from source at `spaceship`
Using cert 1.4.4 from source at `cert`
Using deliver 1.16.0 from source at `deliver`
Using sigh 1.12.0 from source at `sigh`
Using pem 1.4.0 from source at `pem`
Using pilot 1.12.1 from source at `pilot`
Using produce 1.3.2 from source at `produce`
Using xcode-install 2.0.9
Using frameit 3.0.0 from source at `frameit`
Using match 0.11.0 from source at `match`
Using fastlane 1.111.0 from source at `fastlane`
Bundle updated!
[11:18:21]: Your Fastfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
[11:18:21]: -------------------------------------------------
[11:18:21]: --- Step: Verifying required fastlane version ---
[11:18:21]: -------------------------------------------------
[11:18:21]: Your fastlane version 1.111.0 matches the minimum requirement of 1.66.0  โœ…
[11:18:21]: Name of the lane 'crashlytics' is already taken by the action named 'crashlytics'
[11:18:21]: Name of the lane 'appstore' is already taken by the action named 'appstore'
[11:18:21]: Driving the lane 'crashlytics' ๐Ÿš€
[11:18:21]: version: 1.2
[11:18:21]: build: 171
[11:18:21]: -----------------
[11:18:21]: --- Step: gym ---
[11:18:21]: -----------------
[11:18:21]: $ xcodebuild -list -workspace ./MyApp.xcworkspace
2016-12-06 11:18:22.036 xcodebuild[27329:1943537] [MT] DVTPlugInManager: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present
[11:18:23]: $ xcodebuild clean -showBuildSettings -workspace ./MyApp.xcworkspace -scheme MyApp\ AdHoc
2016-12-06 11:18:23.520 xcodebuild[27334:1943600] [MT] DVTPlugInManager: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present
[11:18:24]: Could not fetch SUPPORTED_PLATFORMS from project file: undefined method `split' for nil:NilClass
[11:18:24]: Variable Dump:
[11:18:24]: {:PLATFORM_NAME=>nil, :LANE_NAME=>"crashlytics", :BUILD_NUMBER=>"171", :VERSION_NUMBER=>"1.2"}
[11:18:24]: undefined method `split' for nil:NilClass

+------+-------------------------------------+-------------+
|                     fastlane summary                     |
+------+-------------------------------------+-------------+
| Step | Action                              | Time (in s) |
+------+-------------------------------------+-------------+
| 1    | Verifying required fastlane version | 0           |
| ๐Ÿ’ฅ    | gym                                 | 3           |
+------+-------------------------------------+-------------+

[11:18:24]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

โžก๏ธ  `supported_platforms': [!] undefined method `split' for nil:NilClass (NoMethodError)
   https://github.com/fastlane/fastlane/issues/7141 [closed] 31 ๐Ÿ’ฌ
   10 minutes ago

โžก๏ธ  pilot upload failure undefined method `builds' for nil:NilClass
   https://github.com/fastlane/fastlane/issues/6267 [closed] 9 ๐Ÿ’ฌ
   04 Oct 2016

โžก๏ธ  undefined method `split' for nil:NilClass for OS X screenshots
   https://github.com/fastlane/fastlane/issues/2751 [closed] 3 ๐Ÿ’ฌ
   22 Sep 2016

and 12 more at: https://github.com/fastlane/fastlane/search?q=undefined%20method%20%60split'%20for%20nil&type=Issues&utf8=โœ“
bundler: failed to load command: fastlane (/Users/tomkraina/.gems/bin/fastlane)
NoMethodError: [!] undefined method `split' for nil:NilClass
  /tmp/pr-try-hjanuschka-core_test/fastlane_core/lib/fastlane_core/project.rb:188:in `supported_platforms'
  /tmp/pr-try-hjanuschka-core_test/fastlane_core/lib/fastlane_core/project.rb:176:in `mac?'
  /tmp/pr-try-hjanuschka-core_test/gym/lib/gym/detect_values.rb:69:in `detect_platform'
  /tmp/pr-try-hjanuschka-core_test/gym/lib/gym/detect_values.rb:25:in `set_additional_default_values'
  /tmp/pr-try-hjanuschka-core_test/gym/lib/gym.rb:26:in `config='
  /tmp/pr-try-hjanuschka-core_test/gym/lib/gym/manager.rb:4:in `work'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/actions/gym.rb:24:in `run'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:221:in `block (2 levels) in execute_action'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:206:in `block in execute_action'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:205:in `chdir'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:205:in `execute_action'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:131:in `trigger_action_by_name'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing'
  Fastfile:115:in `block in parsing_binding'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/lane.rb:33:in `call'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:45:in `chdir'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:45:in `execute'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/lane_manager.rb:52:in `cruise_lane'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/command_line_handler.rb:30:in `handle'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/commands_generator.rb:95:in `block (2 levels) in run'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/command.rb:178:in `call'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/command.rb:153:in `run'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/runner.rb:444:in `run_active_command'
  /tmp/pr-try-hjanuschka-core_test/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/delegates.rb:15:in `run!'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/commands_generator.rb:292:in `run'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/commands_generator.rb:36:in `start'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/cli_tools_distributor.rb:51:in `take_off'
  /tmp/pr-try-hjanuschka-core_test/fastlane/bin/fastlane:5:in `<top (required)>'
  /Users/tomkraina/.gems/bin/fastlane:23:in `load'
  /Users/tomkraina/.gems/bin/fastlane:23:in `<top (required)>'

@tomaskraina

@sogko @hjanuschka Any idea what's wrong and how to fix it? How can I help?

@hjanuschka
Member

@tomaskraina can you rerun the try_pr.sh i updated the branch, and added some more debugs

@tomaskraina
tomaskraina commented Dec 7, 2016 edited

@hjanuschka Here you go:

Bundle updated!
[10:01:42]: -------------------------------------------------
[10:01:42]: --- Step: Verifying required fastlane version ---
[10:01:42]: -------------------------------------------------
[10:01:42]: Your fastlane version 1.111.0 matches the minimum requirement of 1.66.0  โœ…
[10:01:42]: Name of the lane 'crashlytics' is already taken by the action named 'crashlytics'
[10:01:42]: Name of the lane 'appstore' is already taken by the action named 'appstore'
[10:01:42]: Driving the lane 'crashlytics' ๐Ÿš€
[10:01:42]: version: 1.2
[10:01:42]: build: 171
[10:01:42]: -----------------
[10:01:42]: --- Step: gym ---
[10:01:42]: -----------------
[10:01:42]: $ xcodebuild -list -workspace ./MyApp.xcworkspace
2016-12-07 10:01:43.031 xcodebuild[77536:3869919] [MT] DVTPlugInManager: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present
[10:01:44]: $ xcodebuild clean -showBuildSettings -workspace ./MyApp.xcworkspace -scheme MyApp\ AdHoc
2016-12-07 10:01:44.526 xcodebuild[77541:3869980] [MT] DVTPlugInManager: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present
[10:01:45]: ### DEBUG:
[10:01:45]: ### DEBUG:undefined method `split' for nil:NilClass
[10:01:45]: ### DEBUG:SUPPORTED_PLATFORMS
[10:01:45]: Could not fetch SUPPORTED_PLATFORMS from project file: undefined method `split' for nil:NilClass
[10:01:45]: Variable Dump:
[10:01:45]: {:PLATFORM_NAME=>nil, :LANE_NAME=>"crashlytics", :BUILD_NUMBER=>"171", :VERSION_NUMBER=>"1.2"}
[10:01:45]: undefined method `split' for nil:NilClass

+------+-------------------------------------+-------------+
|                     fastlane summary                     |
+------+-------------------------------------+-------------+
| Step | Action                              | Time (in s) |
+------+-------------------------------------+-------------+
| 1    | Verifying required fastlane version | 0           |
| ๐Ÿ’ฅ    | gym                                 | 3           |
+------+-------------------------------------+-------------+

[10:01:45]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

โžก๏ธ  `supported_platforms': [!] undefined method `split' for nil:NilClass (NoMethodError)
   https://github.com/fastlane/fastlane/issues/7141 [closed] 34 ๐Ÿ’ฌ
   an hour ago

โžก๏ธ  pilot upload failure undefined method `builds' for nil:NilClass
   https://github.com/fastlane/fastlane/issues/6267 [closed] 9 ๐Ÿ’ฌ
   04 Oct 2016

โžก๏ธ  undefined method `split' for nil:NilClass for OS X screenshots
   https://github.com/fastlane/fastlane/issues/2751 [closed] 3 ๐Ÿ’ฌ
   22 Sep 2016

and 12 more at: https://github.com/fastlane/fastlane/search?q=undefined%20method%20%60split'%20for%20nil&type=Issues&utf8=โœ“
bundler: failed to load command: fastlane (/Users/tomkraina/.gems/bin/fastlane)
NoMethodError: [!] undefined method `split' for nil:NilClass
  /tmp/pr-try-hjanuschka-core_test/fastlane_core/lib/fastlane_core/project.rb:188:in `supported_platforms'
  /tmp/pr-try-hjanuschka-core_test/fastlane_core/lib/fastlane_core/project.rb:176:in `mac?'
  /tmp/pr-try-hjanuschka-core_test/gym/lib/gym/detect_values.rb:69:in `detect_platform'
  /tmp/pr-try-hjanuschka-core_test/gym/lib/gym/detect_values.rb:25:in `set_additional_default_values'
  /tmp/pr-try-hjanuschka-core_test/gym/lib/gym.rb:26:in `config='
  /tmp/pr-try-hjanuschka-core_test/gym/lib/gym/manager.rb:4:in `work'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/actions/gym.rb:24:in `run'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:221:in `block (2 levels) in execute_action'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:206:in `block in execute_action'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:205:in `chdir'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:205:in `execute_action'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:131:in `trigger_action_by_name'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing'
  Fastfile:116:in `block in parsing_binding'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/lane.rb:33:in `call'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:45:in `chdir'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/runner.rb:45:in `execute'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/lane_manager.rb:52:in `cruise_lane'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/command_line_handler.rb:30:in `handle'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/commands_generator.rb:95:in `block (2 levels) in run'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/command.rb:178:in `call'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/command.rb:153:in `run'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/runner.rb:444:in `run_active_command'
  /tmp/pr-try-hjanuschka-core_test/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
  /Users/tomkraina/.gems/gems/commander-4.4.1/lib/commander/delegates.rb:15:in `run!'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/commands_generator.rb:292:in `run'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/commands_generator.rb:36:in `start'
  /tmp/pr-try-hjanuschka-core_test/fastlane/lib/fastlane/cli_tools_distributor.rb:51:in `take_off'
  /tmp/pr-try-hjanuschka-core_test/fastlane/bin/fastlane:5:in `<top (required)>'
  /Users/tomkraina/.gems/bin/fastlane:23:in `load'
  /Users/tomkraina/.gems/bin/fastlane:23:in `<top (required)>'
@sogko
Contributor
sogko commented Dec 7, 2016

@hjanuschka Seems like the def build_settings() returns empty string, curious.

@tomaskraina Could you kindly try the running the xcodebuild command manually in the terminal at your project folder? And share the output with us?

$ xcodebuild clean -showBuildSettings -workspace ./MyApp.xcworkspace -scheme MyApp\ AdHoc

Cheers!

@hjanuschka
Member

thats wierd - please run the above command.

@tomaskraina
tomaskraina commented Dec 7, 2016 edited

It returns nothing besides the info about KSImageNamed.ideplugin plugin (which I can't find in the Plug-ins folder):

Toms-MacBook-Pro-15:MyApp tomkraina$ xcodebuild  -showBuildSettings -workspace ./MyApp.xcworkspace -scheme MyApp\ AdHoc
2016-12-07 10:26:09.930 xcodebuild[77699:3951977] [MT] DVTPlugInManager: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present
Toms-MacBook-Pro-15:GoOut tomkraina$ 
@tomaskraina

Ok, I think I have found what's causing the issue. The scheme 'MyApp AdHoc' is not configured for Running. Only Archive. I guess that Fastlane requires the scheme to be configured for Running in order to archive the target? Was it always like that?

Configuring the scheme for Running makes gym to run without crashing.

screen shot 2016-12-07 at 10 39 08

@sogko
Contributor
sogko commented Dec 7, 2016

@tomaskraina Good catch!
Replicated the same settings on local machine and you are right, xcodebuild returns empty string if the target is not specified to Run for the Build action. And Xcode won't be able to build the project either.

By default, the main target has the Run action enabled. If you try to disable it, it would show the following warning:

screen shot 2016-12-07 at 6 02 48 pm

If you try to build the project (cmd+B), Xcode will show the following error:

screen shot 2016-12-07 at 6 06 39 pm

Hope this helps others.

@tomaskraina
tomaskraina commented Dec 7, 2016 edited

Yes, in Xcode building the target won't work. However, Product > Archive works in Xcode even with Running disabled.

@tomaskraina

Anyway, thank you for your help, guys!

@hjanuschka
Member

thx for the info nice teamwork!

@0xced 0xced referenced this issue Jan 2, 2017
Closed

Running the scan template crashes Fastlane #7682

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment