Can not build using Fastlane gym

Error trying to build with Fastlane gym

Description of the issue

I configured Bitrise to distribute a beta build to Testflight using Fastlane. First of all, it’s working on my computer.
When I run it on Bitrise it goes through Fastlane steps and stops on β€œgym” with error: Code signing is required for product type β€˜Application’ in SDK β€˜iOS 10.2’

Without β€œCertificate and profile installer” workflow I also have error on Match step.

I tried to find a way to solve it and had no success.

Environment:

Xcode 8.2.x, on macOS 10.12 (Sierra)

If on Bitrise .io: which stack? If not on Bitrise .io: on what operating system? (Plus any other information you can share)

Fastlane gym

Reproducibility

  • Does a β€œRebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the β€œRebuild” button in the top right corner of a finished build) : NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • If you have multiple different build configurations (workflows), does the issue affect all/more than one? : NO
  • If it’s an issue which happens sporadically, what’s the frequency? (e.g. Once a day ; about x% of the builds) :
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : Since ever I tried to set it up

Other stacks

Can it be reproduced by running the build locally with our CLI ( ****cli ), after doing a clean git clone (git clone the repository, into a new directory, somewhere on your Mac/PC) and running the build from there with the CLI ( ****cli )?

NO

Build log

Please attach the build log (you can download the build log from the build’s page, once the build is finished, using the β€œDownload log” button - floating at the bottom right corner of the log viewer), or if you can’t attach the whole log then send the full log through a private channel (e.g. email - *******t ), with a link to the related GitHub issue.

  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
  β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•
  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
  β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•
  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
  β•šβ•β•β•β•β•β• β•šβ•β•   β•šβ•β•   β•šβ•β•  β•šβ•β•β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•

e[32;1mVersion: 1.5.1e[0m

e[34mINFOe[0m[07:39:55] e[33;1mbitrise runs in CI modee[0m           
e[34mINFOe[0m[07:39:55] e[32;1mRunning workflow:e[0m primary         

e[34mINFOe[0m[07:39:57] e[34;1mSwitching to workflow:e[0m primary    

+------------------------------------------------------------------------------+
| (0) activate-ssh-key@3.1.1                                                   |
+------------------------------------------------------------------------------+
| id: activate-ssh-key                                                         |
| version: 3.1.1                                                               |
| collection: ****                |
| toolkit: bash                                                                |
| time: 2017-01-03T07:39:59-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |

# Configuration

* Path to save the RSA SSH private key: */Users/vagrant/.ssh/bitrise_step_activate_ssh_key*
* Should remove other identities from the ssh-agent? *true*
-> $ mkdir -p /Users/vagrant/.ssh
-> $ chmod 0600 /Users/vagrant/.ssh/bitrise_step_activate_ssh_key
The agent has no identities.
 (i) ssh_agent_check_result: 1
 (i) running / accessible ssh-agent detected
-> $ ssh-add -D
All identities removed.
SSH_AGENT_PID not set, cannot kill agent
spawn ssh-add /Users/vagrant/.ssh/bitrise_step_activate_ssh_key
Identity added: /Users/vagrant/.ssh/bitrise_step_activate_ssh_key (/Users/vagrant/.ssh/bitrise_step_activate_ssh_key)

# Success

The SSH key was saved to */Users/vagrant/.ssh/bitrise_step_activate_ssh_key*
and was successfully added to ssh-agent.
|                                                                              |
+---+---------------------------------------------------------------+----------+
| e[32;1mβœ“e[0m | e[32;1mactivate-ssh-key@3.1.1e[0m                                        | 4.08 sec |
+---+---------------------------------------------------------------+----------+

                                          β–Ό

+------------------------------------------------------------------------------+
| (1) git-clone@3.4.1                                                          |
+------------------------------------------------------------------------------+
| id: git-clone                                                                |
| version: 3.4.1                                                               |
| collection: ***bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2017-01-03T07:40:03-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
e[34mINFOe[0m[07:40:03]  * e[32;1m[OK]e[0m Step dependency (go) installed, available. 

e[34;1mGit Clone Configs:e[0m
- CloneIntoDir: /Users/vagrant/git
- RepositoryURL: git@bitbucket.org:stonepayments/ios-portal.git
e[34;1mGit Checkout Configs:e[0m
- Commit: 
- Tag: 
- Branch: feature/fastlane
- CloneDepth: 
e[34;1mGit Pull Request Configs:e[0m
- PullRequestURI: 
- PullRequestID: 
- BranchDest: 
- PullRequestMergeBranch: 
- ResetRepository: No
e[34;1mBitrise Build Configs:e[0m
- BuildURL: ***build/6d63d680c18b28e9
- BuildAPIToken: _VQLzsrYPxGctFq1JfLkpQ

e[34;1mGit clone repositorye[0m
=> git "init"
=> git "remote" "add" "origin" "git@bitbucket.org:stonepayments/ios-portal.git"
=> git "fetch"
=> git "checkout" "feature/fastlane"
=> git "submodule" "update" "--init" "--recursive"
e[34;1mExporting git logse[0m
=> GIT_CLONE_COMMIT_HASH
   value: 7114e15dab36240776a114342ca6f080a56d40d7

=> GIT_CLONE_COMMIT_MESSAGE_SUBJECT
   value: IOSPOR-80 Set up match to code sign before upload.

=> GIT_CLONE_COMMIT_MESSAGE_BODY
   value: 

=> GIT_CLONE_COMMIT_AUTHOR_NAME
   value: Jaison Vieira

=> GIT_CLONE_COMMIT_AUTHOR_EMAIL
   value: ****

=> GIT_CLONE_COMMIT_COMMITER_NAME
   value: Jaison Vieira

=> GIT_CLONE_COMMIT_COMMITER_EMAIL
   value: *****

e[32;1mSuccesse[0m
|                                                                              |
+---+---------------------------------------------------------------+----------+
| e[32;1mβœ“e[0m | e[32;1mgit-clone@3.4.1e[0m                                               | 36 sec   |
+---+---------------------------------------------------------------+----------+

                                          β–Ό

+------------------------------------------------------------------------------+
| (2) certificate-and-profile-installer@1.8.2                                  |
+------------------------------------------------------------------------------+
| id: certificate-and-profile-installer                                        |
| version: 1.8.2                                                               |
| collection: *****bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2017-01-03T07:40:39-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
e[34mINFOe[0m[07:40:39]  * e[32;1m[OK]e[0m Step dependency (go) installed, available. 

e[34;1mConfigs:e[0m
 - CertificateURL: ****://s3-***p12
 - CertificatePassphrase: ***
 - ProvisioningProfileURL: ******://s3-***ion
 - DefaultCertificateURL: 
 - DefaultCertificatePassphrase: 
 - DefaultProvisioningProfileURL: 
 - KeychainPath: /Users/vagrant/Library/Keychains/login.keychain
 - KeychainPassword: ***

Provided Certificate count: 1
Provided Provisioning Profile count: 1
Keychain already exists, using it: /Users/vagrant/Library/Keychains/login.keychain

e[34;1mDownloading & installing Certificate(s)e[0m

=> Downloading certificate: 1/1
   Downloading (https://s3-***p12) to (/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise-cert-tmp426131616/Certificate-0.p12)

=> Installing downloaded certificate
e[32;1m   Installed certificate: iPhone Developer: Bitrise Bot (VV2J4SV8V4)e[0m

e[34;1mAvailable certificates:e[0m
-----------------------
 * iPhone Developer: Bitrise Bot (VV2J4SV8V4)

e[34;1mDownloading & installing Provisioning Profile(s)e[0m

=> Downloading provisioning profile: 1/1
   Downloading (https://s3-***ion) to (/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise-cert-tmp426131616/profile-0.mobileprovision)

=> Installing provisioning profile

e[34;1mProfile Infos:e[0m
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>AppIDName</key>
	<string>Xcode iOS Wildcard App ID</string>
	<key>ApplicationIdentifierPrefix</key>
	<array>
	<string>72SA8V3WYL</string>
	</array>
	<key>CreationDate</key>
	<date>2016-02-18T08:56:57Z</date>
	<key>Platform</key>
	<array>
		<string>iOS</string>
	</array>
	<key>DeveloperCertificates</key>
                [REDACTED]
	<key>Entitlements</key>
	<dict>
		<key>keychain-access-groups</key>
		<array>
			<string>72SA8V3WYL.*</string>		
		</array>
		<key>get-task-allow</key>
		<true/>
		<key>application-identifier</key>
		<string>72SA8V3WYL.*</string>
		<key>com.apple.developer.team-identifier</key>
		<string>72SA8V3WYL</string>

	</dict>
	<key>ExpirationDate</key>
	<date>2017-02-17T08:56:57Z</date>
	<key>Name</key>
	<string>BitriseBot-Wildcard</string>
	<key>ProvisionedDevices</key>
                [REDACTED]
	<key>TeamIdentifier</key>
	<array>
		<string>72SA8V3WYL</string>
	</array>
	<key>TeamName</key>
	<string>BITFALL FEJLESZTO KORLATOLT FELELOSSEGU TARSASAG</string>
	<key>TimeToLive</key>
	<integer>365</integer>
	<key>UUID</key>
	<string>225561e6-3526-4edc-a046-7e0fa49eb4fe</string>
	<key>Version</key>
	<integer>1</integer>
</dict>
</plist>

e[32;1m   Installed Profile UUID: 225561e6-3526-4edc-a046-7e0fa49eb4fee[0m
   Moving it to: /Users/vagrant/Library/MobileDevice/Provisioning Profiles/225561e6-3526-4edc-a046-7e0fa49eb4fe.mobileprovision
|                                                                              |
+---+---------------------------------------------------------------+----------+
| e[32;1mβœ“e[0m | e[32;1mcertificate-and-profile-installer@1.8.2e[0m                       | 7.05 sec |
+---+---------------------------------------------------------------+----------+

                                          β–Ό

e[34mINFOe[0m[07:40:45] Step uses latest version -- Updating StepLib ... 
e[34mINFOe[0m[07:40:45] Update StepLib (***/bitrise-io/bitrise-steplib.git)... 
From ***bitrise-io/bitrise-steplib
   7acbe1f..5f2992c  master     -> origin/master
Updating 7acbe1f..5f2992c
Fast-forward
 steps/carthage/3.0.3/step.yml                   |  55 ++++++++++
 steps/xamarin-archive/1.1.2/step.yml            | 115 +++++++++++++++++++++
 steps/xamarin-test-cloud-for-ios/2.1.1/step.yml | 130 ++++++++++++++++++++++++
 3 files changed, 300 insertions(+)
 create mode 100644 steps/carthage/3.0.3/step.yml
 create mode 100644 steps/xamarin-archive/1.1.2/step.yml
 create mode 100644 steps/xamarin-test-cloud-for-ios/2.1.1/step.yml
+------------------------------------------------------------------------------+
| (3) fastlane                                                                 |
+------------------------------------------------------------------------------+
| id: fastlane                                                                 |
| version: 2.2.0                                                               |
| collection: ****bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2017-01-03T07:40:48-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
$ cd .

 (i) No Gemfile found - using system installed fastlane ...
 (i) Updating fastlane ...
$ gem install fastlane --no-document
Successfully installed fastlane-2.3.0
1 gem installed

Fastlane version:
$ fastlane --version
fastlane 2.3.0

Run fastlane:
$ fastlane beta
[07:40:55]: e[32m-------------------------------------------------e[0m
[07:40:55]: e[32m--- Step: Verifying required fastlane version ---e[0m
[07:40:55]: e[32m-------------------------------------------------e[0m
[07:40:55]: Your fastlane version 2.3.0 matches the minimum requirement of 2.2.0  βœ…
[07:40:55]: e[32m------------------------------e[0m
[07:40:55]: e[32m--- Step: default_platform ---e[0m
[07:40:55]: e[32m------------------------------e[0m
[07:40:55]: e[32mDriving the lane 'ios beta' πŸš€e[0m
[07:40:55]: e[32m----------------------e[0m
[07:40:55]: e[32m--- Step: carthage ---e[0m
[07:40:55]: e[32m----------------------e[0m
[07:40:55]: e[4me[36m$ carthage bootstrap --no-use-binaries --platform iOSe[0me[0m
[07:40:56]: β–Έ e[35m*** Cloning Alamofiree[0m
[07:40:57]: β–Έ e[35m*** Cloning Glosse[0m
[07:40:58]: β–Έ e[35m*** Cloning IQKeyboardManagere[0m
[07:41:00]: β–Έ e[35m*** Cloning JTAppleCalendare[0m
[07:41:01]: β–Έ e[35m*** Cloning KeychainAccesse[0m
[07:41:01]: β–Έ e[35m*** Checking out Alamofire at "4.2.0"e[0m
[07:41:02]: β–Έ e[35m*** Checking out Gloss at "1.1.1"e[0m
[07:41:02]: β–Έ e[35m*** Checking out IQKeyboardManager at "v4.0.8"e[0m
[07:41:03]: β–Έ e[35m*** Checking out JTAppleCalendar at "6.1.1"e[0m
[07:41:03]: β–Έ e[35m*** Checking out KeychainAccess at "v3.0.1"e[0m
[07:41:03]: β–Έ e[35m*** xcodebuild output can be found in /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/carthage-xcodebuild.tRKiX9.loge[0m
[07:41:20]: β–Έ e[35m*** Building scheme "Alamofire iOS" in Alamofire.xcworkspacee[0m
[07:43:30]: β–Έ e[35m*** Building scheme "Gloss" in Gloss.xcodeproje[0m
[07:43:58]: β–Έ e[35m*** Building scheme "IQKeyboardManager" in IQKeyboardManager.xcodeproje[0m
[07:44:27]: β–Έ e[35m*** Building scheme "IQKeyboardManagerSwift" in IQKeyboardManager.xcodeproje[0m
[07:45:36]: β–Έ e[35m*** Building scheme "JTAppleCalendar iOS" in JTAppleCalendar.xcworkspacee[0m
[07:46:43]: β–Έ e[35m*** Building scheme "KeychainAccess" in KeychainAccess.xcworkspacee[0m
[07:46:57]: β–Έ e[35m--- xcodebuild: WARNING: Unable to open project file '/Users/vagrant/git/Carthage/Checkouts/KeychainAccess/Examples/Playground-iOS.playground' in workspace '/Users/vagrant/git/Carthage/Checkouts/KeychainAccess/KeychainAccess.xcworkspace'.e[0m
[07:47:20]: β–Έ e[35m--- xcodebuild: WARNING: Unable to open project file '/Users/vagrant/git/Carthage/Checkouts/KeychainAccess/Examples/Playground-iOS.playground' in workspace '/Users/vagrant/git/Carthage/Checkouts/KeychainAccess/KeychainAccess.xcworkspace'.e[0m
[07:47:39]: e[32m------------------------------------e[0m
[07:47:39]: e[32m--- Step: increment_build_number ---e[0m
[07:47:39]: e[32m------------------------------------e[0m
[07:47:39]: e[4me[36m$ cd /Users/vagrant/git && agvtool next-version -all && cd -e[0me[0m
[07:47:44]: β–Έ e[35mSetting version of project StonePortal to:e[0m
[07:47:44]: β–Έ e[35m2.e[0m
[07:47:44]: β–Έ e[35mAlso setting CFBundleVersion key (assuming it exists)e[0m
[07:47:44]: β–Έ e[35mUpdating CFBundleVersion in Info.plist(s)...e[0m
[07:47:44]: β–Έ e[35mUpdated CFBundleVersion in "StonePortal.xcodeproj/../StonePortal/Info.plist" to 2e[0m
[07:47:44]: β–Έ e[35mUpdated CFBundleVersion in "StonePortal.xcodeproj/../StonePortalTests/Info.plist" to 2e[0m
[07:47:44]: β–Έ e[35mUpdated CFBundleVersion in "StonePortal.xcodeproj/../StonePortalUITests/Info.plist" to 2e[0m
[07:47:44]: β–Έ e[35m/Users/vagrant/gite[0m
[07:47:45]: e[32m-------------------e[0m
[07:47:45]: e[32m--- Step: match ---e[0m
[07:47:45]: e[32m-------------------e[0m
[07:47:45]: e[32mSuccessfully loaded '/Users/vagrant/git/fastlane/Matchfile' πŸ“„e[0m

+----------------------+------------------------------------------------+
|              Detected Values from './fastlane/Matchfile'              |
+----------------------+------------------------------------------------+
| git_url              | git@bitbucket.org:stonepayments/ios-portal.git |
| type                 | appstore                                       |
+----------------------+------------------------------------------------+


+-----------------------+------------------------------------------------+
|                        e[32mSummary for match 2.3.0e[0m                         |
+-----------------------+------------------------------------------------+
| git_url               | git@bitbucket.org:stonepayments/ios-portal.git |
| type                  | appstore                                       |
| git_branch            | master                                         |
| app_identifier        | *******                            |
| username              | ****                          |
| keychain_name         | login.keychain                                 |
| keychain_password     | vagrant                                        |
| readonly              | false                                          |
| team_id               | PVKQZY4RFJ                                     |
| verbose               | false                                          |
| force                 | false                                          |
| skip_confirmation     | false                                          |
| shallow_clone         | false                                          |
| force_for_new_devices | false                                          |
| skip_docs             | false                                          |
+-----------------------+------------------------------------------------+

[07:47:45]: Cloning remote git repo...
[07:47:55]: e[32mπŸ”“  Successfully decrypted certificates repoe[0m
[07:47:55]: Verifying that the certificate and profile are still valid on the Dev Portal...
[07:47:57]: Installing certificate...
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1062  100  1062    0     0   3028      0 --:--:-- --:--:-- --:--:--  3025

+-------------------+----------------------------------------------------+
|                         e[32mInstalled Certificatee[0m                          |
+-------------------+----------------------------------------------------+
| User ID           | PVKQZY4RFJ                                         |
| Common Name       | iPhone Distribution: Stone Pagamentos (PVKQZY4RFJ) |
| Organisation Unit | PVKQZY4RFJ                                         |
| Organisation      | Stone Pagamentos                                   |
| Country           | US                                                 |
| Start Datetime    | Jan  3 00:50:47 2017 GMT                           |
| End Datetime      | Jan  3 00:50:47 2018 GMT                           |
+-------------------+----------------------------------------------------+

[07:48:00]: Installing provisioning profile...

+---------------------+------------------------------------------------+--------------------------------------+
|                                       e[32mInstalled Provisioning Profilee[0m                                        |
+---------------------+------------------------------------------------+--------------------------------------+
| Parameter           | Environment Variable                           | Value                                |
+---------------------+------------------------------------------------+--------------------------------------+
| App Identifier      |                                                | ***                  |
| Type                |                                                | appstore                             |
| Profile UUID        | sigh_br.com.stone.portal_appstore              | 592c4138-13be-43b9-aa36-09540e7c0d67 |
| Profile Name        | sigh_br.com.stone.portal_appstore_profile-name | match AppStore br.com.stone.portal   |
| Development Team ID | sigh_br.com.stone.portal_appstore_team-id      | PVKQZY4RFJ                           |
+---------------------+------------------------------------------------+--------------------------------------+

[07:48:00]: e[32me[32mAll required keys, certificates and provisioning profiles are installed πŸ™Œe[0me[0m
[07:48:00]: e[32mπŸ”’  Successfully encrypted certificates repoe[0m
[07:48:00]: Setting Provisioning Profile type to 'app-store'
[07:48:00]: e[32m-----------------e[0m
[07:48:00]: e[32m--- Step: gym ---e[0m
[07:48:00]: e[32m-----------------e[0m
[07:48:01]: e[32mSuccessfully loaded '/Users/vagrant/git/fastlane/Gymfile' πŸ“„e[0m

+---------------------+---------------------+
| Detected Values from './fastlane/Gymfile' |
+---------------------+---------------------+
| output_directory    | ./Build             |
+---------------------+---------------------+

[07:48:01]: e[32mSuccessfully loaded '/Users/vagrant/git/fastlane/Gymfile' πŸ“„e[0m
[07:48:01]: e[33mNo values defined in './fastlane/Gymfile'e[0m
[07:48:01]: e[4me[36m$ xcodebuild -list -project ./StonePortal.xcodeproje[0me[0m
[07:48:02]: e[4me[36m$ xcodebuild clean -showBuildSettings -scheme StonePortal -project ./StonePortal.xcodeproje[0me[0m

+----------------------+-------------------------+
|             e[32mSummary for gym 2.3.0e[0m              |
+----------------------+-------------------------+
| export_method        | app-store               |
| output_directory     | ./Build                 |
| project              | ./StonePortal.xcodeproj |
| scheme               | StonePortal             |
| destination          | generic/platform=iOS    |
| output_name          | StonePortal             |
| clean                | false                   |
| silent               | false                   |
| use_legacy_build_api | false                   |
| buildlog_path        | ~/Library/Logs/gym      |
| xcode_path           | /Applications/Xcode.app |
+----------------------+-------------------------+

[07:48:04]: e[4me[36m$ set -o pipefail && xcodebuild -scheme StonePortal -project ./StonePortal.xcodeproj -destination 'generic/platform=iOS' -archivePath /Users/vagrant/Library/Developer/Xcode/Archives/2017-01-03/StonePortal\ 2017-01-03\ 07.48.04.xcarchive archive | tee /Users/vagrant/Library/Logs/gym/StonePortal-StonePortal.log | xcprettye[0me[0m
[07:48:06]: e[35me[33mβ–Έe[0m e[39;1mBuildinge[0m StonePortal/StonePortal [Release]e[0m
[07:48:06]: e[35me[33mβ–Έe[0m e[39;1mCheck Dependenciese[0me[0m
[07:48:06]: β–Έ e[35me[31m❌  Code signing is required for product type 'Application' in SDK 'iOS 10.2'e[0me[0m
[07:48:06]: β–Έ e[35m** ARCHIVE FAILED **e[0m
[07:48:06]: β–Έ e[35mThe following build commands failed:e[0m
[07:48:06]: β–Έ e[35mCheck dependenciese[0m
[07:48:06]: β–Έ e[35m(1 failure)e[0m
e[33mβ–Έe[0m e[39;1mBuildinge[0m StonePortal/StonePortal [Release]
e[33mβ–Έe[0m e[39;1mCheck Dependenciese[0m

e[31m❌  Code signing is required for product type 'Application' in SDK 'iOS 10.2'e[0m


** ARCHIVE FAILED **


The following build commands failed:
Check dependencies
(1 failure)
[07:48:06]: e[31mExit status: 65e[0m
[07:48:06]: e[33mπŸ“‹  For a more detailed error log, check the full log at:e[0m
[07:48:06]: e[33mπŸ“‹  /Users/vagrant/Library/Logs/gym/StonePortal-StonePortal.loge[0m

+-------------+-------------------------+
|           e[32me[33mBuild environmente[0me[0m           |
+-------------+-------------------------+
| xcode_path  | /Applications/Xcode.app |
| gym_version | 2.3.0                   |
| sdk         | iPhoneOS10.2.sdk        |
+-------------+-------------------------+

+-------------------+-----------+
|         e[33mLane Contexte[0m          |
+-------------------+-----------+
| DEFAULT_PLATFORM  | ios       |
| PLATFORM_NAME     | ios       |
| LANE_NAME         | ios beta  |
| BUILD_NUMBER      | 2         |
| SIGH_PROFILE_TYPE | app-store |
+-------------------+-----------+
[07:48:06]: e[31mError building the application - see the log abovee[0m

+------+-------------------------------------+-------------+
|                     e[32mfastlane summarye[0m                     |
+------+-------------------------------------+-------------+
| Step | Action                              | Time (in s) |
+------+-------------------------------------+-------------+
| 1    | Verifying required fastlane version | 0           |
| 2    | default_platform                    | 0           |
| 3    | carthage                            | 403         |
| 4    | increment_build_number              | 5           |
| 5    | match                               | 15          |
| πŸ’₯    | e[31mgyme[0m                                 | 5           |
+------+-------------------------------------+-------------+

[07:48:06]: e[31mfastlane finished with errorse[0m
e[31m
[!] Error building the application - see the log abovee[0m

e[32m#######################################################################e[0m
e[32m# fastlane 2.3.1 is available. You are on 2.3.0.e[0m
e[32m# It is recommended to use the latest version.e[0m
e[32m# Please update using `sudo gem update fastlane`.e[0m
e[32m#######################################################################e[0m

e[32m2.3.1 Ruby 2.4 and moree[0m
- Add support for Ruby 2.4
- Improve error message when Xcode isn't installed
- Fix an optional property in _deliver_
- Improve documentation
- Add prefix index with zeroes for JUnit reports

e[32mPlease update using `sudo gem update fastlane`e[0m
|                                                                              |
+---+---------------------------------------------------------------+----------+
| e[31;1mxe[0m | e[31;1mfastlane (exit code: 1)e[0m                                       | 442 sec  |
+---+---------------------------------------------------------------+----------+
| Issue tracker: h****/bitrise-io/steps-fastlane/issues           |
| Source: ****bitrise-io/steps-fastlane                         |
+---+---------------------------------------------------------------+----------+

                                          β–Ό

+------------------------------------------------------------------------------+
| (4) deploy-to-bitrise-io@1.2.5                                               |
+------------------------------------------------------------------------------+
| id: deploy-to-bitrise-io                                                     |
| version: 1.2.5                                                               |
| collection: ****/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2017-01-03T07:48:08-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |

=> Preparing step ...

Fetching gem metadata from ****rubygems.org/.
Fetching version metadata from ****rubygems.org/.
Using bundler 1.13.6
Installing plist 3.2.0
Installing rubyzip 1.1.7
Installing ipa_analyzer 0.1.0
Bundle complete! 3 Gemfile dependencies, 4 gems now installed.
Gems in the group test were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

=> Running the step ...


========== Configs ==========
 * Build URL: *****build/6d63d680c18b28e9
 * Build's API Token: _VQLzsrYPxGctFq1JfLkpQ
 * is_compress: false
 * deploy_path: /Users/vagrant/deploy
 * notify_user_groups: everyone
 * notify_email_list: 
 * is_enable_public_page: true

## Uploading the content of the Deploy directory separately

======= List of files =======
 No files found to deploy
=============================


## Success
(i) You can find the Artifact on Bitrise, on the [Build's page](****/build/6d63d680c18b28e9)
|                                                                              |
+---+---------------------------------------------------------------+----------+
| e[32;1mβœ“e[0m | e[32;1mdeploy-to-bitrise-io@1.2.5e[0m                                    | 6.95 sec |
+---+---------------------------------------------------------------+----------+
| Update available: 1.2.5 -> 1.2.6                                             |
+---+---------------------------------------------------------------+----------+


+------------------------------------------------------------------------------+
|                               bitrise summary                                |
+---+---------------------------------------------------------------+----------+
|   | title                                                         | time (s) |
+---+---------------------------------------------------------------+----------+
| e[32;1mβœ“e[0m | e[32;1mactivate-ssh-key@3.1.1e[0m                                        | 4.08 sec |
+---+---------------------------------------------------------------+----------+
| e[32;1mβœ“e[0m | e[32;1mgit-clone@3.4.1e[0m                                               | 36 sec   |
+---+---------------------------------------------------------------+----------+
| e[32;1mβœ“e[0m | e[32;1mcertificate-and-profile-installer@1.8.2e[0m                       | 7.05 sec |
+---+---------------------------------------------------------------+----------+
| e[31;1mxe[0m | e[31;1mfastlane (exit code: 1)e[0m                                       | 442 sec  |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ***bitrise-io/steps-fastlane/issues           |
| Source: ***bitrise-io/steps-fastlane                         |
+---+---------------------------------------------------------------+----------+
| e[32;1mβœ“e[0m | e[32;1mdeploy-to-bitrise-io@1.2.5e[0m                                    | 6.95 sec |
+---+---------------------------------------------------------------+----------+
| Update available: 1.2.5 -> 1.2.6                                             |
+---+---------------------------------------------------------------+----------+
| Total runtime: 496 sec                                                       |
+------------------------------------------------------------------------------+

e[34mINFOe[0m[07:48:14]                                              
e[34mINFOe[0m[07:48:14] Submitting anonymized usage information...   
e[34mINFOe[0m[07:48:14] For more information visit:                  
e[34mINFOe[0m[07:48:14] *****bitrise-core/bitrise-plugins-analytics/blob/master/README.md 
Command failed: exit status 1

Thanks for filling out the report!

Can you try to run codesigndoc on your Mac, and upload all the files to bitrise.io, as described here: http://devcenter.bitrise.io/ios/code-signing/#collect-the-required-files-with-codesigndoc

Just one question before I do it.

I use match from Fastlane to manage certificates and profiles. Is it possible to have my certificates and provisioning profiles to sign my IPA only with match? I mean without using Bitrise’s Code signing workflow?

Sure, it definitely is. You can find a guide here: http://devcenter.bitrise.io/fastlane/how-to-configure-fastlane-match-for-bitrise/

It doesn’t matter from where you get the code signing files, the only thing what matters is to make the required code signing files available somehow :slight_smile:

I followed the steps and had the same error. Seems like the certificates and profiles installed by match can’t be used by gym.

Also this log on match step looks weird:

[09:03:23]: There are no local code signing identities found. You can run `security find-identity -v -p codesigning` to get this output. This Stack Overflow thread has more information: http://stackoverflow.com/q/35390072/774. (Check in Keychain Access for an expired WWDR certificate: http://stackoverflow.com/a/35409835/774 has more info.)

Here is the logs for match and gym steps.

[09:02:59]: -------------------
[09:02:59]: --- Step: match ---
[09:02:59]: -------------------
[09:03:00]: Successfully loaded '/Users/vagrant/git/fastlane/Matchfile' πŸ“„

+----------------------+------------------------------------------------+
|              Detected Values from './fastlane/Matchfile'              |
+----------------------+------------------------------------------------+
| git_url              | git@bitbucket.org:stonepayments/ios-portal.git |
| type                 | appstore                                       |
| readonly             | true                                           |
+----------------------+------------------------------------------------+


+-----------------------+------------------------------------------------+
|                        Summary for match 2.3.0                         |
+-----------------------+------------------------------------------------+
| git_url               | git@bitbucket.org:stonepayments/ios-portal.git |
| type                  | appstore                                       |
| readonly              | true                                           |
| git_branch            | master                                         |
| app_identifier        | br.com.stone.portal                            |
| username              | stoneios@stone.com.br                          |
| keychain_name         | login.keychain                                 |
| keychain_password     | vagrant                                        |
| team_id               | PVKQZY4RFJ                                     |
| verbose               | false                                          |
| force                 | false                                          |
| skip_confirmation     | false                                          |
| shallow_clone         | false                                          |
| force_for_new_devices | false                                          |
| skip_docs             | false                                          |
+-----------------------+------------------------------------------------+

[09:03:00]: Cloning remote git repo...
[09:03:23]: πŸ”“  Successfully decrypted certificates repo
[09:03:23]: Installing certificate...
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1062  100  1062    0     0   2666      0 --:--:-- --:--:-- --:--:--  2668
[09:03:23]: There are no local code signing identities found. You can run `security find-identity -v -p codesigning` to get this output. This Stack Overflow thread has more information: http://stackoverflow.com/q/35390072/774. (Check in Keychain Access for an expired WWDR certificate: http://stackoverflow.com/a/35409835/774 has more info.)

+-------------------+----------------------------------------------------+
|                         Installed Certificate                          |
+-------------------+----------------------------------------------------+
| User ID           | PVKQZY4RFJ                                         |
| Common Name       | iPhone Distribution: Stone Pagamentos (PVKQZY4RFJ) |
| Organisation Unit | PVKQZY4RFJ                                         |
| Organisation      | Stone Pagamentos                                   |
| Country           | US                                                 |
| Start Datetime    | Jan  3 00:50:47 2017 GMT                           |
| End Datetime      | Jan  3 00:50:47 2018 GMT                           |
+-------------------+----------------------------------------------------+

[09:03:25]: Installing provisioning profile...

+---------------------+------------------------------------------------+--------------------------------------+
|                                       Installed Provisioning Profile                                        |
+---------------------+------------------------------------------------+--------------------------------------+
| Parameter           | Environment Variable                           | Value                                |
+---------------------+------------------------------------------------+--------------------------------------+
| App Identifier      |                                                | br.com.stone.portal                  |
| Type                |                                                | appstore                             |
| Profile UUID        | sigh_br.com.stone.portal_appstore              | 592c4138-13be-43b9-aa36-09540e7c0d67 |
| Profile Name        | sigh_br.com.stone.portal_appstore_profile-name | match AppStore br.com.stone.portal   |
| Development Team ID | sigh_br.com.stone.portal_appstore_team-id      | PVKQZY4RFJ                           |
+---------------------+------------------------------------------------+--------------------------------------+

[09:03:25]: All required keys, certificates and provisioning profiles are installed πŸ™Œ
[09:03:25]: πŸ”’  Successfully encrypted certificates repo
[09:03:25]: Setting Provisioning Profile type to 'app-store'
[09:03:25]: -----------------
[09:03:25]: --- Step: gym ---
[09:03:25]: -----------------
[09:03:25]: Successfully loaded '/Users/vagrant/git/fastlane/Gymfile' πŸ“„

+---------------------+---------------------+
| Detected Values from './fastlane/Gymfile' |
+---------------------+---------------------+
| output_directory    | ./Build             |
+---------------------+---------------------+

[09:03:25]: Successfully loaded '/Users/vagrant/git/fastlane/Gymfile' πŸ“„
[09:03:25]: No values defined in './fastlane/Gymfile'
[09:03:25]: $ xcodebuild -list -project ./StonePortal.xcodeproj
[09:03:27]: $ xcodebuild clean -showBuildSettings -scheme StonePortal -project ./StonePortal.xcodeproj

+----------------------+-------------------------+
|             Summary for gym 2.3.0              |
+----------------------+-------------------------+
| export_method        | app-store               |
| output_directory     | ./Build                 |
| project              | ./StonePortal.xcodeproj |
| scheme               | StonePortal             |
| destination          | generic/platform=iOS    |
| output_name          | StonePortal             |
| clean                | false                   |
| silent               | false                   |
| use_legacy_build_api | false                   |
| buildlog_path        | ~/Library/Logs/gym      |
| xcode_path           | /Applications/Xcode.app |
+----------------------+-------------------------+

[09:03:28]: $ set -o pipefail && xcodebuild -scheme StonePortal -project ./StonePortal.xcodeproj -destination 'generic/platform=iOS' -archivePath /Users/vagrant/Library/Developer/Xcode/Archives/2017-01-03/StonePortal\ 2017-01-03\ 09.03.28.xcarchive archive | tee /Users/vagrant/Library/Logs/gym/StonePortal-StonePortal.log | xcpretty
[09:03:30]: β–Έ Building StonePortal/StonePortal [Release]
[09:03:30]: β–Έ Check Dependencies
[09:03:30]: β–Έ ❌  Code signing is required for product type 'Application' in SDK 'iOS 10.2'
[09:03:30]: β–Έ ** ARCHIVE FAILED **
[09:03:30]: β–Έ The following build commands failed:
[09:03:30]: β–Έ Check dependencies
[09:03:30]: β–Έ (1 failure)
β–Έ Building StonePortal/StonePortal [Release]
β–Έ Check Dependencies

❌  Code signing is required for product type 'Application' in SDK 'iOS 10.2'


** ARCHIVE FAILED **


The following build commands failed:
Check dependencies
(1 failure)
[09:03:30]: Exit status: 65
[09:03:30]: πŸ“‹  For a more detailed error log, check the full log at:
[09:03:30]: πŸ“‹  /Users/vagrant/Library/Logs/gym/StonePortal-StonePortal.log

+-------------+-------------------------+
|           Build environment           |
+-------------+-------------------------+
| xcode_path  | /Applications/Xcode.app |
| gym_version | 2.3.0                   |
| sdk         | iPhoneOS10.2.sdk        |
+-------------+-------------------------+

+-------------------+-----------+
|         Lane Context          |
+-------------------+-----------+
| DEFAULT_PLATFORM  | ios       |
| PLATFORM_NAME     | ios       |
| LANE_NAME         | ios beta  |
| BUILD_NUMBER      | 2         |
| SIGH_PROFILE_TYPE | app-store |
+-------------------+-----------+
[09:03:30]: Error building the application - see the log above

+------+-------------------------------------+-------------+
|                     fastlane summary                     |
+------+-------------------------------------+-------------+
| Step | Action                              | Time (in s) |
+------+-------------------------------------+-------------+
| 1    | Verifying required fastlane version | 0           |
| 2    | default_platform                    | 0           |
| 3    | carthage                            | 376         |
| 4    | increment_build_number              | 6           |
| 5    | match                               | 25          |
| πŸ’₯    | gym                                 | 4           |
+------+-------------------------------------+-------------+

[09:03:30]: fastlane finished with errors

Can you please add a second Deploy to Bitrise.io step, and set the path to /Users/vagrant/Library/Logs/gym/StonePortal-StonePortal.log? That will attach this file to the build, so that you can inspect its content (related guide: Build artifacts online - Bitrise Docs )

Once you have that, please post the content of that file here.

This was the result:

User defaults from command line:
    IDEArchivePathOverride = /Users/vagrant/Library/Developer/Xcode/Archives/2017-01-03/StonePortal 2017-01-03 10.27.56.xcarchive

=== BUILD TARGET StonePortal OF PROJECT StonePortal WITH CONFIGURATION Release ===

Check dependencies
No profiles for 'br.com.stone.portal' were found:  Xcode couldn't find a provisioning profile matching 'br.com.stone.portal'.
Code signing is required for product type 'Application' in SDK 'iOS 10.2'

Is there any kind of permission that Fastlane needs to have? The profiles were supposed to be installed by match. That’s how it works on my local machine.

Do you use Automatic code signing in Xcode?

If you do, you have to include the Wildcard, Development, Team Provisioning Profile too. Xcode uses this for an initial code signing of the xcode archive, and only after that it does re-sign with the final code signing files, when it generates the IPA. You can find more information about this here: http://devcenter.bitrise.io/ios/code-signing-technical-details/#how-ios-code-signing-works-if-you-use-xcode-8-automatic-code-signing

You can use codesigndoc to collect all the files required for the initial xcode archive (.xcarchive) signing - it runs an archive on your Mac, it analyzes Xcode’s output to see which code signing files it used, and then it exports those files for you.

Reflecting on β€œThat’s how it works on my local machine.” : correct, but you have this Wildcard Team Dev prov profile on your Mac - it’s downloaded automatically when you sign into Xcode.

1 Like

Now it passed but I was blocked for reaching more than 600 seconds. Is there a way that I could run it before buying? I would like to make it work before asking my boss to pay.

I really liked this tool.

And thanks a lot for helping!!!

I’m glad to hear that and sure, just ping us either through email (https://www.bitrise.io/contact) or through the onsite chat, and we’ll reactivate a trial for you!

Thank you very much. I could run the build til the end. Really awesome!

1 Like

I am getting the same issue I cannot resolve it. I use fastlane match to manage my certificates and I use XCode 8 and I DONT manage certificates and provisioning profiles automatically. It is all defined manually for each build configuration. I can build everything locally but I doesn’t work on bitrise whe I use the ad-hoc build configuration. Gym fails when trying to build showing the same error about not finding the signing certificate. In my case

[14:32:24]: β–Έ No certificate matching β€˜iPhone Distribution: Syrmo Inc (7SMPV9L38V)’ for team β€˜7SMPV9L38V’: Select a different signing certificate for CODE_SIGN_IDENTITY, a team that matches your selected certificate, or switch to automatic provisioning.

I started having this issue because I was trying to solve a different problem. Originally my build was hanging when executing the run script to copy frameworks required by Carthage. After spending hours on different GitHub issues (both in Carthage & Fastlane) I came to the conclusion that problem might be related somehow with keychains. I was creating a new keychain in my lane and I thought that somehow having a different keychain might cause copy-frameworks to hang somehow (an issue I found on GitHub let me to think that). So I deleted the lines from my fastlane that were instructing match to use a specific keychain and use the default one. But when I did this gym could not find the signing certificates.

Any idea on how to solve this issue or if you happen to know problem with copy-frameworks hanging?

If you only use the fastlane tools for managing your code signing and generating the IPA, then you should ask this on the fastlane forums/support, they are more experienced with providing support for fastlane tools, we’re not actively involved in the development of fastlane.

This can happen on Sierra when the new keychain is not properly unlocked, as in that case Keychain will present a popup where you have to β€œAllow” manually.

On Sierra you have to do this command, in additional to the β€œregular” ones which worked before Sierra - related code from our Certificate Installer step: https://github.com/bitrise-io/steps-certificate-and-profile-installer/blob/master/main.go#L569

(security "set-key-partition-list" "-S" "apple-tool:,apple:" "-k" KEYCHAIN_PASSWORD KEYCHAIN_PATH)

Set the signing to automatic on Xcode and do as @viktorbenei said here: Can not build using Fastlane gym

1 Like

I found turning off automatic codesigining and setting which profile to use does the trick.

1 Like