Fastlane: "no implicit conversion of nil into String" when testing an SPM package

Viewed 882

I'm trying to use Fastlane to run some tests on an SPM package, but I'm getting a rather vague error

no implicit conversion of nil into String

My Fastlane lane looks like this:

lane tests_ios do
    TEST_PACKAGE_PATHS.each { |package_path|
        scan(
            workspace: WORKSPACE_NAME,
            package_path: package_path,
            devices: TEST_DEVICES_IOS,
            code_coverage: true
        )
    }
end

I'm guessing there's a parameter missing? Except there's no indication which one exactly.

How to solve this? Or at least how to get a more detailed error message to point me in the right direction?

Here's full output from terminal:

+------------------------------------------------+-----------------------------------------------------+
|                                       Summary for scan 2.202.0                                       |
+------------------------------------------------+-----------------------------------------------------+
| workspace                                      | MyWorkspace.xcworkspace                             |
| package_path                                   | MyPackage                                           |
| devices                                        | ["iPhone 13 Pro Max"]                               |
| code_coverage                                  | true                                                |
| skip_detect_devices                            | false                                               |
| ensure_devices_found                           | false                                               |
| force_quit_simulator                           | false                                               |
| reset_simulator                                | false                                               |
| disable_slide_to_type                          | true                                                |
| reinstall_app                                  | false                                               |
| clean                                          | false                                               |
| open_report                                    | false                                               |
| output_directory                               | ./fastlane/test_output                              |
| output_types                                   | html,junit                                          |
| buildlog_path                                  | ~/Library/Logs/scan                                 |
| include_simulator_logs                         | false                                               |
| xcodebuild_formatter                           | xcpretty                                            |
| output_remove_retry_attempts                   | false                                               |
| should_zip_build_products                      | false                                               |
| output_xctestrun                               | false                                               |
| result_bundle                                  | false                                               |
| use_clang_report_name                          | false                                               |
| disable_concurrent_testing                     | false                                               |
| skip_build                                     | false                                               |
| slack_use_webhook_configured_username_and_icon | false                                               |
| slack_username                                 | fastlane                                            |
| slack_icon_url                                 | https://fastlane.tools/assets/img/fastlane_icon.png |
| skip_slack                                     | false                                               |
| slack_only_on_failure                          | false                                               |
| xcodebuild_command                             | env NSUnbufferedIO=YES xcodebuild                   |
| skip_package_dependencies_resolution           | false                                               |
| disable_package_automatic_updates              | false                                               |
| use_system_scm                                 | false                                               |
| number_of_retries                              | 0                                                   |
| fail_build                                     | true                                                |
| xcode_path                                     | /Applications/Xcode.app                             |
+------------------------------------------------+-----------------------------------------------------+
 
+------------------------------+-----------+
|               Lane Context               |
+------------------------------+-----------+
| DEFAULT_PLATFORM             | ios       |
| PLATFORM_NAME                |           |
| LANE_NAME                    | tests_ios |
| SCAN_GENERATED_XCRESULT_PATH |           |
+------------------------------+-----------+
[15:07:09]: no implicit conversion of nil into String
 
+------+---------------------------------------+-------------+
|                      fastlane summary                      |
+------+---------------------------------------+-------------+
| Step | Action                                | Time (in s) |
+------+---------------------------------------+-------------+
| 1    | default_platform                      | 0           |
| 2    | Switch to setup lane                  | 0           |
| 3    | Switch to remove_build lane           | 0           |
| 4    | ([ -d build ] && rm -r build) || true | 0           |
| 5    | swiftgen                              | 0           |
|    | scan                                  | 0           |
+------+---------------------------------------+-------------+
 
[15:07:09]: fastlane finished with errors
 
Looking for related GitHub issues on fastlane/fastlane...
 
➡️  Collision between `trainer` inside Fastlane and `trainer` gem
    https://github.com/fastlane/fastlane/issues/19834 [open] 2 
    a day ago
 
➡️  Deliverfile api_key: connect_api/token.rb:62:in `binread': [!] no implicit conversion of nil into String
    https://github.com/fastlane/fastlane/issues/19348 [closed] 2 
    4 weeks ago
 
➡️  Remove XCPretty dependency and add xcbeautify as an option
    https://github.com/fastlane/fastlane/pull/19629 [closed] 30 
    5 days ago
 
and 91 more at: https://github.com/fastlane/fastlane/search?q=no%20implicit%20conversion%20of%20nil%20into%20String&type=Issues&utf8=✓
 
  You can ⌘ + double-click on links to open them directly in your browser.
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/scan/lib/scan/runner.rb:178:in `join': [!] no implicit conversion of nil into String (TypeError)
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/scan/lib/scan/runner.rb:178:in `find_xcresults_in_derived_data'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/scan/lib/scan/runner.rb:23:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/scan/lib/scan/manager.rb:23:in `work'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/actions/run_tests.rb:17:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
    from Fastfile:79:in `block (2 levels) in parsing_binding'
    from Fastfile:78:in `each'
    from Fastfile:78:in `block in parsing_binding'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/lane.rb:33:in `call'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/commands_generator.rb:109:in `block (2 levels) in run'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
    from /Library/Ruby/Gems/2.6.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/commands_generator.rb:353:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/commands_generator.rb:42:in `start'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
    from /Library/Ruby/Gems/2.6.0/gems/fastlane-2.202.0/bin/fastlane:23:in `<top (required)>'
    from /usr/local/bin/fastlane:23:in `load'
    from /usr/local/bin/fastlane:23:in `<main>'
1 Answers

I figured it out

scan(
  package_path: package,
  scheme: package,
  devices: devices,
  output_directory: './' + package  + '/' + TEST_OUTPUT_DIR,
  buildlog_path: TEST_BUILDLOG_PATH,
  derived_data_path: DERIVED_DATA_PATH,
  code_coverage: true,
  result_bundle: true,
  fail_build: false,
  clean: true,
  configuration: "Debug"
)
Related