fastlane: Mac Notarize Failing

New Issue Checklist

Issue Description

I am attempting to Notarize my Mac DMG file but I am receiving this error.

/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/actions/notarize.rb:50:in `run': [!] undefined method `[]' for nil:NilClass (NoMethodError)

I can run the command line tool just fine

 xcrun altool --notarize-app --primary-bundle-id "MYBUNDLEID" --username APPLEID --password APPLEPASSWORD --file MYAPP.dmg
Command executed
$ bundle exec fastlane mac beta 
platform :mac do
  lane :beta do
    #build_app(workspace: "MYAPP.xcworkspace", scheme: "MYAPP")
    #upload_to_testflight
    version = get_version_number(
  	xcodeproj: "./MYAPP.xcodeproj",
 	 target: "MYAPP"
    ) 
    notarize(
        package:"./myAPPdmg",
        bundle_id: "MY_BUNDLE_ID"    
    )
  end
end
Complete output when running fastlane, including the stack trace and command used
$ bundle exec fastlane mac beta 
[βœ”] πŸš€ 
[06:31:46]: Driving the lane 'mac beta' πŸš€
[06:31:46]: --------------------------------
[06:31:46]: --- Step: get_version_number ---
[06:31:46]: --------------------------------
[06:31:46]: ----------------------
[06:31:46]: --- Step: notarize ---
[06:31:46]: ----------------------
[06:31:46]: Uploading package to notarization service, might take a while
+----------------+----------+
|       Lane Context        |
+----------------+----------+
| PLATFORM_NAME  | mac      |
| LANE_NAME      | mac beta |
| VERSION_NUMBER | 9.6.0    |
+----------------+----------+

+------+--------------------+-------------+
|            fastlane summary             |
+------+--------------------+-------------+
| Step | Action             | Time (in s) |
+------+--------------------+-------------+
| 1    | get_version_number | 0           |
| πŸ’₯   | notarize           | 1           |
+------+--------------------+-------------+

[06:31:47]: fastlane finished with errors

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

➑️  undefined method `strip' for nil:NilClass
    https://github.com/fastlane/fastlane/issues/16076 [open] 1 πŸ’¬
    4 days ago

➑️  [deliver] submit_build, promote build to production: undefined method `select_build' for nil:NilClass
    https://github.com/fastlane/fastlane/issues/16084 [open] 3 πŸ’¬
    11 hours ago

➑️  [Swift] undefined method `each' for nil:NilClass - Cannot Create Group Within FastlaneSwiftRunner Project
    https://github.com/fastlane/fastlane/issues/15184 [open] 21 πŸ’¬
    a day ago

and 424 more at: https://github.com/fastlane/fastlane/search?q=undefined%20method%20%60%5B%5D%27%20for%20nil&type=Issues&utf8=βœ“

πŸ”—  You can ⌘ + double-click on links to open them directly in your browser.
Traceback (most recent call last):
	28: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
	27: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
	26: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/bin/fastlane:23:in `<main>'
	25: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/bin/fastlane:23:in `load'
	24: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/bin/fastlane:23:in `<top (required)>'
	23: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/cli_tools_distributor.rb:119:in `take_off'
	22: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	21: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/commands_generator.rb:349:in `run'
	20: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	19: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!'
	18: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	17: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	16: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	15: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	14: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	13: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	12: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	11: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	10: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	 9: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	 8: from Fastfile:27:in `block (2 levels) in parsing_binding'
	 7: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
	 6: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
	 5: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
	 4: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:227:in `chdir'
	 3: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:253:in `block in execute_action'
	 2: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
	 1: from /Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/runner.rb:261:in `block (2 levels) in execute_action'
/Users/_kane7161/.rvm/gems/ruby-2.6.3/gems/fastlane-2.142.0/fastlane/lib/fastlane/actions/notarize.rb:50:in `run': [!] undefined method `[]' for nil:NilClass (NoMethodError)

Environment

βœ… fastlane environment βœ…

Stack

Key Value
OS 10.15.3
Ruby 2.6.3
Bundler? true
Git git version 2.10.1
Installation Source ~/.rvm/gems/ruby-2.6.3/bin/fastlane
Host Mac OS X 10.15.3 (19D49f)
Ruby Lib Dir ~/.rvm/rubies/ruby-2.6.3/lib
OpenSSL Version OpenSSL 1.1.1d 10 Sep 2019
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 11.3.1

System Locale

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

fastlane files:

`./fastlane/Fastfile`
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

#Issues: https://github.com/fastlane/fastlane/issues/15184


platform :mac do
  lane :beta do
    #build_app(workspace: "MYAPP.xcworkspace", scheme: "MYAPP")
    #upload_to_testflight
    version = get_version_number(
  	xcodeproj: "./MYAPP.xcodeproj",
 	 target: "MYAPP"
    ) 
    notarize(
        package:"./MYAPP.dmg",
        bundle_id: "me. MYAPP"    
    )
  end
end

`./fastlane/Appfile`
app_identifier("me. MYAPP y") # The bundle identifier of your app
apple_id("") # Your Apple email address

itc_team_id("") # App Store Connect Team ID
team_id("") # Developer Portal Team ID

# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

Gem Version Update-Status
fastlane 2.142.0 βœ… Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
did_you_mean 1.3.0
executable-hooks 1.6.0
bundler-unload 1.0.2
rubygems-bundler 1.4.5
bundler 2.1.4
CFPropertyList 3.0.2
public_suffix 2.0.5
addressable 2.7.0
atomos 0.1.3
babosa 1.0.3
claide 1.0.3
colored 1.2
colored2 3.1.2
highline 1.7.10
commander-fastlane 4.4.6
declarative 0.0.10
declarative-option 0.1.0
digest-crc 0.4.1
unf_ext 0.0.7.6
unf 0.1.4
domain_name 0.5.20190701
dotenv 2.7.5
emoji_regex 1.0.1
excon 0.72.0
multipart-post 2.0.0
faraday 0.17.3
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
faraday_middleware 0.13.1
fastimage 2.1.7
gh_inspector 1.1.3
jwt 2.1.0
memoist 0.16.2
multi_json 1.14.1
os 1.0.1
signet 0.13.0
googleauth 0.11.0
httpclient 2.8.3
mini_mime 1.0.2
uber 0.1.0
representable 3.0.4
retriable 3.1.2
google-api-client 0.36.4
google-cloud-env 1.3.0
google-cloud-errors 1.0.0
google-cloud-core 1.5.0
google-cloud-storage 1.25.1
json 2.3.0
mini_magick 4.10.1
multi_xml 0.6.0
plist 3.5.0
rubyzip 1.3.0
security 0.1.3
naturally 2.2.0
simctl 1.6.8
slack-notifier 2.3.2
terminal-notifier 2.0.0
unicode-display_width 1.6.1
terminal-table 1.8.0
tty-screen 0.7.1
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
nanaimo 0.2.6
xcodeproj 1.15.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.0

generated on: 2020-02-29

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 17

Most upvoted comments

What worked for me was:

In case anybody else wants to use a keychain password, this works for me:

serviceName = "XCODE_NOTARIZE_PASSWORD"
accountName = CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
cmd = "security find-generic-password -a #{accountName} -s #{serviceName} -w -g | tr -d '\n'"  
ENV["FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD"] = sh( command:cmd, log:false)

# notarize...

Just add a password with keychain item name β€œXCODE_NOTARIZE_PASSWORD” to your keychain.