fastlane-old / gym

Building your iOS apps has never been easier
https://fastlane.tools
645 stars 54 forks source link

Getting expand_path crash while running gym #166

Closed skalber-mm closed 8 years ago

skalber-mm commented 8 years ago

Hello,

I trying to build my app using fastlane and circleci and getting a crash on expand_path inside the gym module.

Here's my fastline file:

fastlane_version "1.48.0"

platform :ios do
    lane :circleci do

    create_keychain(
        name: "###",
        default_keychain: true,
        unlock: true,
        timeout: 3600,
        lock_when_sleeps: true,
        password: "####"
    )

    import_certificate(
        certificate_path: "fastlane/certificates/ios_distribution.cer",
        keychain_name: "###"
    )

    import_certificate(
        certificate_path: "fastlane/certificates/distribution.p12",
        certificate_password: "####",
        keychain_name: "##"
    )

    sigh(
        app_identifier: "com.applicaster.tvml",
        username: "s.borkin@applicaster.com",
        cert_id: "###",
    )

    ENV["PROFILE_UDID"] = lane_context[SharedValues::SIGH_UDID]
    gym(
        use_legacy_build_api: true,
        clean: true,
        scheme: "ApplicasterTVML",
        codesigning_identity: "iPhone Distribution: Applicaster Ltd",
        destination: "generic/platform=tvOS",
        output_directory: "build/",
        output_name: "ApplicasterTVML.ipa"
    )

    ENV['FASTLANE_PASSWORD']='####'
    pilot(
        username: "###",
        ipa: "build/ApplicasterTVML.ipa"
    )

    end
end

The output:

04:11:40: --- Step: Verifying required fastlane version ---

04:11:40: fastlane version valid
04:11:40: Driving the lane 'ios circleci' 🚀

04:11:40: --- Step: create_keychain ---

04:11:40: [SHELL COMMAND]: security list-keychains -d user

04:11:40: --- Step: import_certificate ---

04:11:40: --- Step: import_certificate ---

04:11:40: --- Step: sigh ---

+-------------------------------------+--------------------------+
| Summary for sigh 1.2.1 |
+-------------------------------------+--------------------------+
| adhoc | false |
| skip_install | false |
| development | false |
| force | false |
| app_identifier | ### |
| username | ### |
| ignore_profiles_with_different_name | false |
| cert_id | ### |
| skip_fetch_profiles | false |
| skip_certificate_verification | false |
+-------------------------------------+--------------------------+

04:11:40: Starting login with user '###'
[04:11:42]: Successfully logged in
[04:11:42]: Fetching profiles...
[04:11:48]: Found 1 matching profile(s)
[04:11:48]: Downloading provisioning profile...
04:11:49: Successfully downloaded provisioning profile...
04:11:49: Installing provisioning profile...
/Users/distiller/TVML-DemoApp-tvOS/AppStore_com.applicaster.tvml.mobileprovision
04:11:49: Setting Provisioning Profile type to 'app-store'

04:11:49: --- Step: gym ---

04:11:49: Using legacy build system - waiting for radar to be fixed: https://openradar.appspot.com/radar?id=4952000420642816
04:11:49: Installing provisioning profile...
04:11:49: xcrun xcodebuild -list -project './ApplicasterTVML.xcodeproj'

+---------------------------+----------------------------------------------------------------------------------+
| Summary for gym 1.2.0 |
+---------------------------+----------------------------------------------------------------------------------+
| project | ./ApplicasterTVML.xcodeproj |
| scheme | ApplicasterTVML |
| clean | true |
| output_directory | build/ |
| output_name | ApplicasterTVML |
| silent | false |
| codesigning_identity | ### |
| include_symbols | true |
| include_bitcode | false |
| use_legacy_build_api | true |
| export_method | app-store |
| buildlog_path | ~/Library/Logs/gym |
| provisioning_profile_path | /Users/distiller/TVML-DemoApp-tvOS/AppStore_com.applicaster.tvml.mobileprovision |
| destination | generic/platform=tvOS |
+---------------------------+----------------------------------------------------------------------------------+

[04:11:51]: xcrun xcodebuild -showBuildSettings -scheme 'ApplicasterTVML' -project './ApplicasterTVML.xcodeproj'
[04:11:52]: $ set -o pipefail && xcodebuild -scheme 'ApplicasterTVML' -project './ApplicasterTVML.xcodeproj' -destination 'generic/platform=tvOS' -archivePath '/Users/distiller/Library/Developer/Xcode/Archives/2015-12-21/ApplicasterTVML 2015-12-21 04.11.51.xcarchive' clean archive CODE_SIGN_IDENTITY='####' | tee '/Users/distiller/Library/Logs/gym/ApplicasterTVML-ApplicasterTVML.log' | xcpretty
[04:11:54]: > ▸ Cleaning ApplicasterTVML/ApplicasterTVML [Debug]
[04:11:54]: > ▸ Check Dependencies
[04:11:54]: > ▸ Clean Succeeded
[04:11:54]: > ▸ Building ApplicasterTVML/ApplicasterTVML [Release]
[04:11:54]: > ▸ Check Dependencies
[04:11:54]: > ▸ Compiling AppDelegate.swift
[04:11:57]: > ▸ Linking ApplicasterTVML
[04:12:00]: > ▸ Processing Info.plist
[04:12:00]: > ▸ Generating 'ApplicasterTVML.app.dSYM'
[04:12:00]: > ▸ Touching ApplicasterTVML.app
[04:12:04]: > ▸ Signing /Users/distiller/Library/Developer/Xcode/DerivedData/ApplicasterTVML-cdfikdgufuqgycdtamkrshhbqzvf/Build/Intermediates/ArchiveIntermediates/ApplicasterTVML/InstallationBuildProductsLocation/Applications/ApplicasterTVML.app
[04:12:04]: > ▸ Touching ApplicasterTVML.app.dSYM
[04:12:05]: > ▸ Archive Succeeded
[04:12:05]: Successfully stored the archive. You can find it in the Xcode Organizer.
[04:12:05]: Variable Dump:
[04:12:05]: {:PLATFORM_NAME=>:ios, :LANE_NAME=>"ios circleci", :ORIGINAL_DEFAULT_KEYCHAIN=>"\"/Users/distiller/Library/Keychains/login.keychain\"", :SIGH_PROFILE_PATH=>"/Users/distiller/TVML-DemoApp-tvOS/AppStore_com.applicaster.tvml.mobileprovision", :SIGH_PROFILE_PATHS=>["/Users/distiller/TVML-DemoApp-tvOS/AppStore_com.applicaster.tvml.mobileprovision"], :SIGH_UDID=>"###", :SIGH_PROFILE_TYPE=>"app-store"}
[04:12:05]: no implicit conversion of nil into String

+------+-------------------------------------+-------------+
| fastlane summary |
+------+-------------------------------------+-------------+
| Step | Action | Time (in s) |
+------+-------------------------------------+-------------+
| 1 | Verifying required fastlane version | 0 |
| 2 | create_keychain | 0 |
| 3 | import_certificate | 0 |
| 4 | import_certificate | 0 |
| 5 | sigh | 9 |
| 6 | gym | 15 |
+------+-------------------------------------+-------------+

[04:12:05]: fastlane finished with errors

😨 An error occured. Please enable crash reports using fastlane enable_crash_reporting.
👍 This makes resolving issues much easier and helps improve fastlane.
🔒 The reports will be stored securely on getsentry.com.
✨ Once crash reporting is enabled, you get a clean output when something goes wrong.

🙊 More information about privacy: https://github.com/KrauseFx/fastlane/releases/tag/1.33.3

/Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/actions/gym.rb:22:in expand_path': no implicit conversion of nil into String (TypeError) from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/actions/gym.rb:22:inrun'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/runner.rb:142:in block (2 levels) in execute_action' from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/actions/actions_helper.rb:37:inexecute_action'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/runner.rb:128:in block in execute_action' from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/runner.rb:127:inchdir'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/runner.rb:127:in execute_action' from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/fast_file.rb:149:inmethod_missing'
from Fastfile:35:in block (2 levels) in parsing_binding' from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/lane.rb:36:incall'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/lane.rb:36:in call' from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/runner.rb:51:inblock in execute'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/runner.rb:46:in chdir' from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/runner.rb:46:inexecute'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/lane_manager.rb:46:in cruise_lane' from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/lib/fastlane/command_line_handler.rb:30:inhandle'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/bin/fastlane:37:in block (2 levels) in run' from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:incall'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in call' from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:153:inrun'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in run_active_command' from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:68:inrun!'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in run!' from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/bin/fastlane:155:inrun'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-1.48.0/bin/fastlane:161:in <top (required)>' from /usr/bin/fastlane:23:inload'

bundle exec fastlane ios circleci returned exit code 1

from /usr/bin/fastlane:23:in `

' Action failed: bundle exec fastlane ios circleci
lacostej commented 8 years ago

I looked at the stack. It seems to indicate that actions/gym fails because it receives a nil by Gym::Runner.run(). This would mean that a nil IPA path was returned somewhat.

I don't see how that can happens without returning more output.

The run() method at least reached the build_app stage, but after that I am confused at what happened. There's no print out of the moving of the file or any of the commands that happen after the build step as if output was missing (which could happen on a CI server because of strange syncing issues).

I would try to enable gym's verbose mode and see if there's more to it.

56 might have helped but it was not merged :)

fastlane-bot-helper commented 8 years ago

This issue was migrated to https://github.com/fastlane/fastlane/issues/1834. Please post all further comments there.

fastlane is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo :rocket: