GithubHelp home page GithubHelp logo

steps-ios-auto-provision's Introduction

iOS Auto Provision with Apple ID (Deprecated)

Step changelog

Automatically manages your iOS Provisioning Profiles for your Xcode project.

Description

This Step has been deprecated in favour of the new automatic code signing options on Bitrise.

You can read more about these changes in our blog post: https://blog.bitrise.io/post/simplifying-automatic-code-signing-on-bitrise.

Option A)

The latest versions of the Xcode Archive & Export for iOS, Xcode Build for testing for iOS, and the Export iOS and tvOS Xcode archive Steps have built-in automatic code signing. We recommend removing this Step from your Workflow and using the automatic code signing feature in the Steps mentioned above.

Option B)

If you are not using any of the mentioned Xcode Steps, then you can replace this iOS Auto Provision Step with the Manage iOS Code signing Step.

Description

The Step uses session-based authentication to connect to an Apple Developer account. In addition to an Apple ID and password, it also stores the 2-factor authentication (2FA) code you provide.

Please note that the iOS Auto Provision with App Store Connect API Step uses the official App Store Connect API instead of the old session-based method.

The iOS Auto Provision with Apple ID Step supports in Xcode managed and manual code signing in the following ways:

In the case of Xcode managed code signing projects, the Step:

  • Downloads the Xcode managed Provisioning Profiles and installs them for the build.
  • Installs the provided code signing certificates into the Keychain. In the case of manual code signing projects, the Step:
  • Ensures that the Application Identifier exists on the Apple Developer Portal.
  • Ensures that the project's Capabilities are set correctly in the Application Identifier.
  • Ensures that the Provisioning Profiles exist on the Apple Developer Portal and are installed for the build.
  • Ensures that all the available Test Devices exist on the Apple Developer Portal and are included in the Provisioning Profiles.
  • Installs the provided code signing certificates into the Keychain.

Configuring the Step

Before you start configuring the Step, make sure you've completed the following requirements:

To configure the Step: Once you've completed the above requirements, there is very little configuration needed to this Step.

  1. Add the iOS Auto Provision with Apple ID Step after any dependency installer Step in your Workflow, such as Run CocoaPods install or Carthage.
  2. Click the Step to edit its input fields. You can see that the Distribution type, Xcode Project (or Workspace) path, and the Scheme name inputs are automatically filled out for you.
  3. If your Developer Portal Account belongs to multiple development teams, add the Developer Portal team ID to manage the project's code signing files, for example '1MZX23ABCD4'. If that's not the case, you can still add it to manage the Provisioning Profiles with a different team than the one set in your project. If you leave it empty, the team defined by the project will be used.
  4. If you wish to overwrite the configuration defined in your Scheme (for example, Debug, Release), you can do so in the Configuration name input.
  5. If Xcode managed signing is enabled in the iOS app, check the value of the Should the step try to generate Provisioning Profiles even if Xcode managed signing is enabled in the Xcode project? input.
  • If it’s set to 'no', the Step will look for an Xcode Managed Provisioning Profile on the Apple Developer Portal.
  • If it’s set to 'yes', the Step will generate a new manual provisioning profile on the Apple Developer portal for the project. This input has no effect in the case of Manual code signing projects.
  1. The minimum days the Provisioning Profile should be valid lets you specify how long a Provisioning Profile should be valid to sign an iOS app. By default it will only renew the Provisioning Profile when it expires.

Troubleshooting

Please note that the 2FA code is only valid for 30 days. When the 2FA code expires, you will need to re-authenticate to provide a new code. Go to the Apple Developer Account of the Account settings page, it will automatically ask for the 2FA code to authenticate again. There will be a list of the Apple Developer accounts that you have defined. To the far right of each, there are 3 dots. Click the dots and select Re-authenticate (2SA/2FA).

Useful links

Related Steps

🧩 Get started

Add this step directly to your workflow in the Bitrise Workflow Editor.

You can also run this step directly with Bitrise CLI.

βš™οΈ Configuration

Inputs
Key Description Flags Default
distribution_type Describes how Xcode should sign your project. required development
team_id The Developer Portal team to manage the project's code signing files. If your Developer Portal Account belongs to multiple development team, this input is required! Otherwise specify this input if you want to manage the Provisioning Profiles with a different team than the one set in your project. If you leave it empty the team defined by the project will be used. Example: 1MZX23ABCD4
project_path A .xcodeproj or .xcworkspace path. required $BITRISE_PROJECT_PATH
scheme The Xcode Scheme to use. required $BITRISE_SCHEME
configuration The Xcode Configuration to use. By default your Scheme defines which Configuration (Debug, Release, ...) should be used, but you can overwrite it with this option.
generate_profiles In the case of Xcode managed code signing projects, by default the step downloads and installs the Xcode managed Provisioning Profiles. If this input is set to: yes, the step will try to manage the Provisioning Profiles by itself (like in the case of Manual code signing projects), the step will fall back to use the Xcode managed Provisioning Profiles if there is an issue. This input has no effect in the case of Manual codesigning projects. no
register_test_devices If set the step will register known test devices on Bitrise from team members with the Apple Developer Portal. Note that setting this to "yes" may cause devices to be registered against your limited quantity of test devices in the Apple Developer Portal, which can only be removed once annually during your renewal window. no
min_profile_days_valid Sometimes you want to sign an app with a Provisioning Profile that is valid for at least 'x' days. For example, an enterprise app won't open if your Provisioning Profile is expired. With this parameter, you can have a Provisioning Profile that's at least valid for 'x' days. By default (0) it just renews the Provisioning Profile when expired. 0
verbose_log Enable verbose logging? required no
certificate_urls URLs of the certificates to download. Multiple URLs can be specified, separated by a pipe (|) character, you can specify a local path as well, using the file:// scheme. Provide a development certificate url, to ensure development code signing files for the project and also provide a distribution certificate url, to ensure distribution code signing files for your project. Example: file://./development/certificate/path|https://distribution/certificate/url required, sensitive $BITRISE_CERTIFICATE_URL
passphrases Certificate passphrases. Multiple passphrases can be specified, separated by a pipe (|) character. Specified certificate passphrase count should match the count of the certificate URLs. For example, (1 certificate with empty passphrase, 1 certificate with non-empty passphrase) |distribution-passphrase. required, sensitive $BITRISE_CERTIFICATE_PASSPHRASE
keychain_path The Keychain path. required $HOME/Library/Keychains/login.keychain
keychain_password The Keychain's password. required, sensitive $BITRISE_KEYCHAIN_PASSWORD
build_url Bitrise build URL. required $BITRISE_BUILD_URL
build_api_token Bitrise build API token. required, sensitive $BITRISE_BUILD_API_TOKEN
Outputs
Environment Variable Description
BITRISE_EXPORT_METHOD The selected distribution type. One of these: development, app-store, ad-hoc or enterprise.
BITRISE_DEVELOPER_TEAM The development team's ID. Example: 1MZX23ABCD4
BITRISE_DEVELOPMENT_CODESIGN_IDENTITY The development code signing identity's name. For example, iPhone Developer: Bitrise Bot (VV2J4SV8V4).
BITRISE_PRODUCTION_CODESIGN_IDENTITY The production code signing identity's name. Example: iPhone Distribution: Bitrise Bot (VV2J4SV8V4)
BITRISE_DEVELOPMENT_PROFILE The main target's development provisioning profile's UUID. Example: c5be4123-1234-4f9d-9843-0d9be985a068
BITRISE_PRODUCTION_PROFILE The main target's production provisioning profile UUID. Example: c5be4123-1234-4f9d-9843-0d9be985a068

πŸ™‹ Contributing

We welcome pull requests and issues against this repository.

For pull requests, work on your changes in a forked repository and use the Bitrise CLI to run step tests locally.

Note: this step's end-to-end tests (defined in e2e/bitrise.yml) are working with secrets which are intentionally not stored in this repo. External contributors won't be able to run those tests. Don't worry, if you open a PR with your contribution, we will help with running tests and make sure that they pass.

Learn more about developing steps:

steps-ios-auto-provision's People

Contributors

0if avatar banyikanna avatar bence1001 avatar birmacherakos avatar bitrise-coresteps-bot avatar bootstraponline avatar clementleroy avatar doomsayer13 avatar godrei avatar istvankovacs-bitrise avatar jabeattie avatar leedsalex avatar lpusok avatar m4rr avatar ofalvai avatar renovate[bot] avatar richard-bogdan-bitrise avatar rpecka avatar sepperousseau avatar szabadember avatar trapacska avatar ubuntudroid avatar viktorbenei avatar zoltan-baba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

steps-ios-auto-provision's Issues

Failed to find scheme archivable target

I'm getting an error in this step. Log is below
Note that we're using Automatic signing in Xcode. Is this supported?

+------------------------------------------------------------------------------+
| (6) [email protected]                                                 |
+------------------------------------------------------------------------------+
| id: ios-auto-provision                                                       |
| version: 0.9.7                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2018-02-28T20:39:47-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
$ bundle install
$ bundle exec ruby /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise247414974/step_src/step.rb
Params:
team_id: 3PU2FX2MA5
certificate_urls: ***
passphrases: 
distribution_type: ad-hoc
project_path: Axis.xcodeproj
scheme: Axis_iOS QA2
configuration: 
build_url: https://www.bitrise.io/build/77eeabf1c133195f
build_api_token: ***
keychain_path: /Users/vagrant/Library/Keychains/login.keychain
keychain_password: ***
verbose_log: no
Developer Portal authentication
authenticated
Downloading Certificates
1 certificate files downloaded, 2 codesign identities included
Identify Certificates on developer Portal
production Certificate identified: iOS Distribution
provided an older version of iPhone Developer: Yonas Kolb (XY7TEP9H45) certificate, please provide the most recent version of the certificate
provided an older version of iPhone Developer: Yonas Kolb (XY7TEP9H45) certificate, please provide the most recent version of the certificate
provided an older version of iPhone Developer: Yonas Kolb (XY7TEP9H45) certificate, please provide the most recent version of the certificate
development Certificate identified: iOS Development
Analyzing project
Error:
failed to find scheme archivable target
Stacktrace (for debugging):
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise247414974/step_src/project_helper/project_helper.rb:260:in `read_scheme_archivable_target_and_container_project'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise247414974/step_src/project_helper/project_helper.rb:23:in `initialize'
/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise247414974/step_src/step.rb:200:in `new'
/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise247414974/step_src/step.rb:200:in `<main>'

Don't work when try to work with mac devices

Step fails when trying to find certificates in developer portal Xcode 11

Hello
This step fails when trying to find/check certificates in developer portal.
I followed up this doc to import certificates to Bitrise (I've exported from Xcode and key chain).

Conditions
I have admin rights for my developer account.
ios-auto-provision version is 1.3.2
This project was created under Xcode 10, but I've started setting up Bitrise for building and deploying after Xcode 11 released. I use Xcode 11 as well. I did local archiving and ad-hoc export.

What I did
I've tried to reconnect my apple developer account - no luck
I've tried different export methods (ad-hoc, develop, app-store) - no luck

Here is console output during this step

+------------------------------------------------------------------------------+
| id: ios-auto-provision                                                       |
| version: 1.3.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2019-10-02T07:11:00Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
$ bundle install
$ bundle exec ruby /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise436132521/step_src/step.rb

arams:
team_id: *****
certificate_urls: ***
min_profile_days_valid: 0
passphrases: ***
distribution_type: app-store
project_path: Hi Rooms/Hi Rooms.xcworkspace
scheme: Hi Rooms
configuration: 
build_url: https://app.bitrise.io/build/bf3a48a53a90045c
build_api_token: ***
keychain_path: /Users/vagrant/Library/Keychains/login.keychain
keychain_password: ***
verbose_log: yes
generate_profiles: no

original SPACESHIP_AVOID_XCODE_API: 
SPACESHIP_AVOID_XCODE_API cleared

Developer Portal authentication
developer portal data url: https://app.bitrise.io/build/bf3a48a53a90045c/apple_developer_portal_data.json
build_api_token: [REDACTED]
session cookie: {"https://idmsa.apple.com"=>[{"name"=>"DES5efd73e0f31cd1cf212595c0f2918ee1c", "path"=>"/", "value"=>"HSARMTKNSRVXWFlaCq6aiLSBW2jV0sKJspjBwvwyoPmejl69g1uSjjCKEzbEglqekAaIzYHto60mhRRpQN+D5zf/qGADtfPUspbBkShbNc+zC92era0RXQse/SirhgYOhkq66zd0/izr34DjSRVX", "domain"=>"idmsa.apple.com", "secure"=>true, "expires"=>"2019-10-26T06:20:44Z", "max_age"=>2592000, "httponly"=>true}, {"name"=>"myacinfo", "path"=>"/", "value"=>"DAWTKNV2f4e104b8754f61b6dbf0ddab601ebd7e51dd4ae2cf2a1bd7f6c4f1bca6dec57ce18065efe7e6585665bdf9a325747541a3826c74df2e09687dcea162cf8469cbd7b4f32342966e4387a55b923b0fd25c12d6958b541df8e3944f8939b828df48bf3d5f4761d65b8d46f5abfa0e9ff7f9ef017e7fbfe6d3ccfc916e839511f9b581ee8d504abf5e2f820182951ac9ddd49ea6dc89812f289a96a092c7fe2cbc2cc39f04d4ae0c0a5d0fd57942e916af0e36027e2ba139456f9702c570b767667061b788326a6c0e3b25b4ec3d9464488bb1d08c7e7aff4c4a97c786548d0512585237a60c8faeccb4f71ed90adad1a6f84d27900873c0c2924481a8506cb83278967aa7702ec0f89b1a6f44bf5f905e2bccdfd9f2d3fcb504f55678cc9e80b25cd388c7d0e8186dd208a9a27bb73f729987a592e71e8029f12547d1f139981c0f3b178676ac758532328bf989fe47cd99aaee9b02e4e3b32b07199767ac9a99d1cf82dd250507de9fa65b5ca7d07a384c36deb5e3e7b9418dc536474ae81410fd34353761373163663535636438333661333963646561663664663833313435363531343439303664MVRYV2", "domain"=>"apple.com", "secure"=>true, "httponly"=>true}]}
converted session cookies:
---
- !ruby/object:HTTP::Cookie
  name: DES5efd73e0f31cd1cf212595c0f2918ee1c
  value: HSARMTKNSRVXWFlaCq6aiLSBW2jV0sKJspjBwvwyoPmejl69g1uSjjCKEzbEglqekAaIzYHto60mhRRpQN+D5zf/qGADtfPUspbBkShbNc+zC92era0RXQse/SirhgYOhkq66zd0/izr34DjSRVX
  domain: idmsa.apple.com
  for_domain: true
  path: "/"
- !ruby/object:HTTP::Cookie
  name: myacinfo
  value: DAWTKNV2f4e104b8754f61b6dbf0ddab601ebd7e51dd4ae2cf2a1bd7f6c4f1bca6dec57ce18065efe7e6585665bdf9a325747541a3826c74df2e09687dcea162cf8469cbd7b4f32342966e4387a55b923b0fd25c12d6958b541df8e3944f8939b828df48bf3d5f4761d65b8d46f5abfa0e9ff7f9ef017e7fbfe6d3ccfc916e839511f9b581ee8d504abf5e2f820182951ac9ddd49ea6dc89812f289a96a092c7fe2cbc2cc39f04d4ae0c0a5d0fd57942e916af0e36027e2ba139456f9702c570b767667061b788326a6c0e3b25b4ec3d9464488bb1d08c7e7aff4c4a97c786548d0512585237a60c8faeccb4f71ed90adad1a6f84d27900873c0c2924481a8506cb83278967aa7702ec0f89b1a6f44bf5f905e2bccdfd9f2d3fcb504f55678cc9e80b25cd388c7d0e8186dd208a9a27bb73f729987a592e71e8029f12547d1f139981c0f3b178676ac758532328bf989fe47cd99aaee9b02e4e3b32b07199767ac9a99d1cf82dd250507de9fa65b5ca7d07a384c36deb5e3e7b9418dc536474ae81410fd34353761373163663535636438333661333963646561663664663833313435363531343439303664MVRYV2
  domain: apple.com
  for_domain: true
  path: "/"

Session loaded from environment variable is not valid. Continuing with normal login.
authenticated
Downloading Certificates
downloading certificate #1
certificate source: /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_0.p12
1 codesign identities included:
- Apple Distribution: ***
downloading certificate #2
certificate source: /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/Certrificate_1.p12
1 codesign identities included:
- Apple Development: **** 
2 certificate files downloaded, 2 distinct codesign identities included
Identify Certificates on Developer Portal
Development certificates on Apple Developer Portal:
Production certificates on Apple Developer Portal:
searching for Certificate: Apple Distribution: ***
searching for Certificate: Apple Development:***

Error:
no development nor production certificate identified on development portal

Step failing on 1.3.1 but working on 1.3.0 and 1.2.3

Hi, I wanted to report a problem with the latest version of this step. It's reproducable each time:

On step version 1.3.1 there is this error:

Failed to find development Xcode managed provisioning profile for bundle id: ...
Please open your project in your local Xcode and generate and ipa file
with the desired distribution type and by using Xcode managed codesigning.
This will create / refresh the desired managed profiles.

On step versions 1.3.0 and 1.2.3 everything works normally without that error and app is correctly signed.

Any ideas?

Auth error

I started to get the following error today:

Developer Portal authentication
Error:
{"authType"=>"sa"}
aa=C643F815345F9C5438CA6CB194F3; Domain=idmsa.apple.com; Path=/; Secure; HttpOnly, dslang=US-EN; Domain=apple.com; Path=/; Secure; HttpOnly, site=USA; Domain=apple.com; Path=/; Secure; HttpOnly, acn01=vZQmP3RNZATYW5wPZOVERBYCzAAQPoORz927; Max-Age=31536000; Expires=Wed, 22-May-2019 11:24:50 GMT; Domain=apple.com; Path=/; Secure; HttpOnly
Stacktrace (for debugging):
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.88.0/spaceship/lib/spaceship/client.rb:469:in `send_shared_login_request'
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.88.0/spaceship/lib/spaceship/portal/portal_client.rb:27:in `send_login_request'
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.88.0/spaceship/lib/spaceship/client.rb:653:in `do_login'
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.88.0/spaceship/lib/spaceship/client.rb:358:in `login'
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.88.0/spaceship/lib/spaceship/client.rb:71:in `login'
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.88.0/spaceship/lib/spaceship/portal/spaceship.rb:25:in `login'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise135372514/step_src/lib/autoprovision/portal/auth_client.rb:9:in `login'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise135372514/step_src/lib/autoprovision/auth_helper.rb:31:in `login'
/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise135372514/step_src/step.rb:18:in `<main>'
|                                                                           

Seems like the step fails on authorization. Any ideas?

Step version 1.1.0

1.2.0 build introduces issues for app extensions without profiles

Our app (automatically managed profiles) uses a Notification Extension, and the latest version will cause our build to fail.

Relevant part of log:

Ensure Provisioning Profiles on Developer Portal

checking xcode managed development profile for target: (com.[REDACTED]) with 2 services on developer portal
downloading development profile: iOS Team Provisioning Profile: com.[REDACTED]
checking xcode managed development profile for target: Notification Service (com.[REDACTED].notification-service) with 1 services on developer portal

Error:
Failed to find development Xcode managed provisioning profile for bundle id: com.[REDACTED].notification-service.

Rolling back to 1.1.5 will prevent the issue occurring.

My best guess at the problem is that our extension does not use its own provisioning profile, it uses the wildcard profile, and because of this the step has no profile to find and fails. In my experience it is pretty common for the notification extension to be assigned the wildcard profile, at least for develop build.

We will use 1.1.5 for now but hopefully this is something that can be addressed in a future build, or am I misreading the situation?

developer portal apple id not provided for this build

I faced an error while trying to auto provision

Error:
developer portal apple id not provided for this build
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise547694375/step_src/lib/autoprovision/auth_data.rb:21:in `validate'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise547694375/step_src/lib/autoprovision/auth_helper.rb:21:in `login'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise547694375/step_src/step.rb:25:in `<main> 

No field is provided to enter the portal apple id in the workflow
Any Help with it ?

Update xcodeproj for Xcode 11 support

Hello,

My build outputs the following warning:

$ bundle exec ruby /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise759033711/step_src/step.rb
[!] Xcodeproj doesn't know about the following attributes {"platformFilter"=>"ios"} for the 'PBXBuildFile' isa.
If this attribute was generated by Xcode please file an issue: https://github.com/CocoaPods/Xcodeproj/issues/new

This seems to be a new Xcode 11 attribute. The "xcodeproj" maintainers seem to have released an update: CocoaPods/Xcodeproj#687

Note that the build fails later with:

Error:
[Xcodeproj] Unknown object version.
Stacktrace (for debugging):
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcodeproj-1.7.0/lib/xcodeproj/project.rb:223:in `initialize_from_file'

which seems to be fixable by updating xcodeproj too.

Could you please update the dependencies?
Thanks.

Error in uses_xcode_auto_codesigning when missing TargetAttributes

This is similar to the issue logged in #18
It's crashing if TargetAttributes is nil or doesn't contain the target id

...
Error:
undefined method `[]' for nil:NilClass
Stacktrace (for debugging):
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise598287177/step_src/lib/autoprovision/project_helper.rb:56:in `uses_xcode_auto_codesigning?'

Error: Can't find class 'adhoc'

Hi while doing the auto-provisioning step I'm receiving this error, this was working some days ago but after updating a new provisioning profile I'm getting this error. Also we're using a developer profile in order to signin the project and we are not provisioning for adhoc.

Here is the stack trace of the error, tried with multiple versions and none of them worked:
generate_profiles set to true, but failed to generate Provisioning Profiles with error:
Can't find class 'adhoc'
Trying to use Xcode managed Provisioning Profiles
checking xcode managed development profile for target: TheTicketMaster (com.scrnz.theticket) with 1 services on developer portal
Error:
Can't find class 'adhoc'
Stacktrace (for debugging):
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.102.0/spaceship/lib/spaceship/portal/provisioning_profile.rb:207:in factory' /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.102.0/spaceship/lib/spaceship/portal/provisioning_profile.rb:321:in block in all'
/usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.102.0/spaceship/lib/spaceship/portal/provisioning_profile.rb:321:in map!' /usr/local/lib/ruby/gems/2.5.0/gems/fastlane-2.102.0/spaceship/lib/spaceship/portal/provisioning_profile.rb:321:in all'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/portal/profile_client.rb:137:in block in fetch_profiles' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/portal/common.rb:10:in run_and_handle_portal_function'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/portal/profile_client.rb:137:in fetch_profiles' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/portal/profile_client.rb:11:in ensure_xcode_managed_profile'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/profile_helper.rb:65:in block in ensure_xcode_managed_profiles' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/profile_helper.rb:59:in each'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/profile_helper.rb:59:in ensure_xcode_managed_profiles' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/profile_helper.rb:40:in block in ensure_profiles'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/profile_helper.rb:38:in each' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/profile_helper.rb:38:in ensure_profiles'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/profile_helper.rb:32:in rescue in ensure_profiles' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/lib/autoprovision/profile_helper.rb:25:in ensure_profiles'
/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise758575677/step_src/step.rb:89:in `

'

Thank you,

bundle install failed with Xcode 10.2.x Stack

Hi!
Since we updated to Swift 5 and changed the default stack to Xcode 10.2.x on macOS10.14 the workflow ios-auto-provision fails:

id: ios-auto-provision
version: 1.3.1
collection: https://github.com/bitrise-io/bitrise-steplib.git
toolkit: bash
time: 2019-05-20T15:00:53Z

$ bundle install rbenv: version 2.5.1 is not installed (set by /Users/vagrant/git/.ruby-version) bundle install failed

Any idea what is wrong?
Thank you in advanced.

Wrong Distribution type selected

Version: 1.2.2
I'm using app-store distribution type in the configuration, but when trying to upload app to App Store, xcode-archive failed with error:

Provisioning profile "Bitrise development - (co.massive.axis.demo)" doesn't support the Access WiFi Information capability.

It is using development profile rather than app-store profile.

However, I tried with version 1.2.0 and xcode-archive did use the correct distribution type.
Please find attached logs for 1.2.0 and 1.2.2
1.2.0.log
1.2.2.log

Install certificate error with complex password

Hello.
I uploaded the certificate (p12) with complex password:

DKQt)VF5@0HK\GG{-\3

On Bitrise step it was failed with error:

Install certificates
sh: -c: line 0: syntax error near unexpected token )' sh: -c: line 0: security import "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/Certrificate_0.p12" -k "/Users/vagrant/Library/Keychains/login.keychain" -P DKQt)VF5@0HK\GG{-\3 -A'

Error:
security import "/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/Certrificate_0.p12" -k "/Users/vagrant/Library/Keychains/login.keychain" -P DKQt)VF5@0HK\GG{-\3 -A failed, out:

Stacktrace (for debugging):
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/lib/autoprovision/keychain_helper.rb:50:in import_certificate' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/lib/autoprovision/keychain_helper.rb:33:in block in install_certificates'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/lib/autoprovision/keychain_helper.rb:32:in each' /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/lib/autoprovision/keychain_helper.rb:32:in install_certificates'
/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise055551208/step_src/step.rb:136:in `

'

Seems password in command should be quoted to prevent this issue.

Build Failed : Bundler cannot continue

Team, please help we are facing issue because of Bundler error.

$ bundle install
bundle install failed
Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running gem install bundler. Fetching gem metadata from https://rubygems.org/ Fetching version metadata from https://rubygems.org/ Fetching dependency metadata from https://rubygems.org/ Using CFPropertyList 3.0.0 Installing public_suffix 2.0.5 Installing ast 2.4.0 Using atomos 0.1.2 Using babosa 1.0.2 Using claide 1.0.2 Using colored 1.2 Using colored2 3.1.2 Installing highline 1.7.10 Installing declarative 0.0.10 Installing declarative-option 0.1.0 Installing diff-lcs 1.3 Installing unf_ext 0.0.7.5 with native extensions Installing dotenv 2.2.1 Installing excon 0.62.0 Using multipart-post 2.0.0 Installing fastimage 2.1.1 Using bundler 1.12.1 Using gh_inspector 1.1.3 Installing jwt 2.1.0 Using little-plugger 1.1.4 Installing multi_json 1.13.1 Installing memoist 0.16.0 Using os 0.9.6 Installing httpclient 2.8.3 Installing mime-types-data 3.2016.0521 Installing uber 0.1.0 Installing retriable 3.1.1 Installing json 2.1.0 with native extensions Using mini_magick 4.5.1 Installing multi_xml 0.6.0 Installing plist 3.4.0 Installing rubyzip 1.2.1 Using security 0.1.3 Installing naturally 2.1.0 Installing slack-notifier 2.3.2 Installing terminal-notifier 1.8.0 Installing unicode-display_width 1.3.0 Installing tty-screen 0.6.4 Installing tty-cursor 0.5.0 Installing word_wrap 1.0.0 Installing nanaimo 0.2.4 Installing rouge 2.0.7 Installing openssl 2.1.0 with native extensions Gem::InstallError: openssl requires Ruby version >= 2.3.0. Installing parallel 1.12.1 Installing powerpack 0.1.1 Installing rainbow 3.0.0 Installing rspec-support 3.7.1 Installing ruby-progressbar 1.9.0 Installing addressable 2.5.2 Installing parser 2.5.0.5 Installing commander-fastlane 4.4.6 Using unf 0.1.4 Installing faraday 0.14.0 Installing logging 2.2.2 Installing mime-types 3.1 Installing representable 3.0.4 Installing simctl 1.6.2 Installing terminal-table 1.8.0 Installing tty-spinner 0.8.0 Installing xcodeproj 1.5.7 Installing xcpretty 0.2.8 An error occurred while installing openssl (2.1.0), and Bundler cannot continue. Make sure that gem install openssl -v '2.1.0' succeeds before bundling.

Thanks.

Generating Provisioning Profiles with Member Account

Hi,

First of all, i would like to thank you for your effort in creating this Bitrise step.
While i was trying out the step, i've encountered some usability issues and got an idea that i would like to share with you.

Thy are described in details below, but here are the highlights:

  • allowing to associate Apple Developer account from Bitrise account that is not admin
  • automatic provisioning profiles generation, based on automatic code sining
  • functionality for Member Apple Developer accounts, eg. automatic provisioning profiles generation.

Connecting Apple Developer account

In our organization, we use system accounts for automation and integration with various of services. These accounts are not usable by any person directly and usually have very limited access, usually the lowest possible, in order to pipe trough any external access and in order to be managed easily.
For example, in order to connect to apple, we have service accounts for Bitrise and Apple.
The Bitrise one has only view builds permission and the Apple one is Member.

The usability issue, i've discovered is that in order to associate Apple Developer account with a project from the Team tab, it has to be from a User that has admin access.
I believe it should not be necessary to require admin access.

Xcode Automatic Code Sining and Provisioning

We use Automatic Code Sining and thus we don't use and generate provisioning profiles for our development builds. The only provisioning profile we have is the one for the AppStore.

This removes a huge burden from our shoulders, except the one that we have to manually upload the autogenerated provisioning profiles to Bitrise, in case anything change, eg we add a new device.

Giving so, the functionality that we would require is a step that would autogenerate the provisioning profiles, the same way Xcode does, however the current steps tries to add devices and manage stuffs on the portal, that we don't like to happen. We prefer to have a clean portal and nothing to touch whatever is there, like Xcode does.

Requiring Admin Access from Apple Developer account

Since the step tries to manage stuffs on the Apple Developer Portal, it requires an Admin access.
As mentioned above, and having the fact that authorizing an account with such access raises security concerns, it would be good to have and be able to use some functionality options from the step for accounts that do not have admin access to the Apple Developer Portal

Revoking push certificates

When I added this step instead "Certificate and profile installer" it revoked both my push certificates. Build passes and everything was ok, but app can't receive push notifications.
On Apple dev portal certificates are missing

undefined method `icloud'

We are getting the following error during the ios-auto-provision step (current version v1.5.3).

Ensure Provisioning Profiles on Developer Portal
checking app for target: ContactMapping (com.contactmapping.mobile) on developer portal
Push Notifications already enabled
set CloudKit: on
set iCloud: on
Error:
undefined method `icloud' for Spaceship::Portal::AppService:Class
Did you mean?  cloud
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise794133273/step_src/lib/autoprovision/portal/app_client.rb:192:in `sync_app_services'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise794133273/step_src/lib/autoprovision/profile_helper.rb:90:in `block in ensure_manual_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise794133273/step_src/lib/autoprovision/profile_helper.rb:81:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise794133273/step_src/lib/autoprovision/profile_helper.rb:81:in `ensure_manual_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise794133273/step_src/lib/autoprovision/profile_helper.rb:42:in `block in ensure_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise794133273/step_src/lib/autoprovision/profile_helper.rb:38:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise794133273/step_src/lib/autoprovision/profile_helper.rb:38:in `ensure_profiles'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise794133273/step_src/step.rb:90:in `<main>'
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision (exit code: 1)                             | 42.12 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision          |
+---+---------------------------------------------------------------+----------+

I wanted to confirm that the iCloud key was in fact valid. So here is where it's called in this step. Specifically:

        else
          Log.success('set CloudKit: on')
          app = app.update_service(Spaceship::Portal.app_service.cloud_kit.cloud_kit)
        end

        if app_features['iCloud']
          Log.print('iCloud: already set')
        else
          Log.success('set iCloud: on')
          app = app.update_service(Spaceship::Portal.app_service.icloud.on)
        end

Now if I go to the spaceship developer docs here, the currently available services for the Spaceship::Portal.app_service. prefix does specify icloud.(on|off). So I'm somewhat at a dead end on trying to figure out what to do next.

I do note that I'm still on fastlane 2.160 (I had to pin because of an earlier break). So I will try moving that to 2.163.

Step fails when Apple distribution certificate is added in Bitrise (Xcode 11)

We just set up new project which uses Xcode 11. Xcode 11 supports new type of certificate - Apple Distribution certficates. When such certificate is added to Code Signing Identities, this step fails, even when given workflow relies on different certificate (e.g. enterprise distribution certificate):

Downloading Certificates
Error:
undefined method `subject' for nil:NilClass
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise094332727/step_src/lib/autoprovision/utils.rb:2:in `certificate_common_name'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise094332727/step_src/lib/autoprovision/utils.rb:10:in `certificate_name_and_serial'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise094332727/step_src/lib/autoprovision/certificate_helper.rb:31:in `block (2 levels) in download_and_identify'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise094332727/step_src/lib/autoprovision/certificate_helper.rb:30:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise094332727/step_src/lib/autoprovision/certificate_helper.rb:30:in `block in download_and_identify'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise094332727/step_src/lib/autoprovision/certificate_helper.rb:21:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise094332727/step_src/lib/autoprovision/certificate_helper.rb:21:in `each_with_index'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise094332727/step_src/lib/autoprovision/certificate_helper.rb:21:in `download_and_identify'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise094332727/step_src/step.rb:37:in `<main>'

Always failing with invalid parameter UDID

Since last week this step is always failing with the following error:

registering device
Failed to register device: POST https://api.appstoreconnect.apple.com/v1/devices: 409
- ENTITY_ERROR.ATTRIBUTE.INVALID: An attribute in the provided entity has invalid value: An invalid value '3D7FADF5-D61B-5F6B-A254-XXXXXXXXX' was provided for the parameter 'udid'.

(Changed the last values of the UDID so I do not post it in full here).

Up to last week this was working properly. This happens to more than one applications on bitrise.

Step fails due to Bundler on 11.2 stack

When running the step on the Xcode 11.2 stack, the following error presents itself:

ERROR: Error installing bundler:
"bundle" from bundler conflicts with /Users/vagrant/.rbenv/versions/2.6.5/bin/bundle

This is due to the change that was merged 4 hours ago in #107 and has also been commented on in #107 (comment) .

Error: Developer Portal Authentication

I am experiencing the following error:

Developer Portal authentication
Error:
developer portal apple id not provided for this build
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise663306743/step_src/lib/autoprovision/auth_data.rb:21:in `validate'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise663306743/step_src/lib/autoprovision/auth_helper.rb:21:in `login'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise663306743/step_src/step.rb:25:in `<main>'

Which should be related to this line:

https://github.com/bitrise-steplib/steps-ios-auto-provision/blob/master/lib/autoprovision/auth_data.rb#L21

From where is apple_id being read? I have connected my Apple Account to Bitrise, as well attempted to create both secret and env variables with the name APPLE_ID

Test devices are not being added to new provisioning profile on 1.2.3

I added a new test device on Bitrise (and the Apple Dev Portal just to be sure), so the build says all devices are already registered with nothing to do. "generate_profiles" is also set to yes but then no profiles seem to be created, instead downloading one that does not include the new test device, without any apparent errors. I can't try any previous versions to 1.2.3 due to issue #49 (regarding adhoc and fastlane) to see if this might be working previously.

Distribution type from env vars

Hi,

Would be possible to set the dist type from env vars?

This would help on more complex workflows with different schemes.

Incorrect platform provisioning profile

If there are multiple provisioning profiles with the same bundleID (for example for iOS and tvOS), the auto provision step sometimes downloads the incorrect provisioning profile. This causes signing to fail later. It should check the type for the correct platform

Here you can see it downloads the correct development profile, but incorrect distribution profile:

Analyzing project
project codesign identity: iPhone Developer
project team id: 3PU2FX2MA5
uses xcode managed signing: true
target #0: Axis_iOS (co.massive.axis.demo) with 0 services
Matching project codesign identity with the uploaded certificates
using: iPhone Developer: Yonas Kolb (XY7TEP9H45) [2904252714206315985]
using: iPhone Distribution: Massive Interactive Pty Ltd (3PU2FX2MA5) [9139218735286723938]
Ensure Provisioning Profiles on Developer Portal
checking xcode managed development profile for target: Axis_iOS (co.massive.axis.demo) with 0 services on developer portal
downloading development profile: iOS Team Provisioning Profile: co.massive.axis.demo
checking xcode managed app-store profile for target: Axis_iOS (co.massive.axis.demo) with 0 services on developer portal
downloading app-store profile: tvOS Team Store Provisioning Profile: co.massive.axis.demo

This then creates an error in the Xcode Archive step

error: exportArchive: No "iOS App Store" profiles for team '3PU2FX2MA5' matching 'tvOS Team Store Provisioning Profile: co.massive.axis.demo' are installed.

Throws Error

Error:
undefined method `casecmp' for nil:NilClass
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/portal/profile_client.rb:176:in `distribution_type_matches?'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/portal/profile_client.rb:58:in `block in ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/portal/profile_client.rb:57:in `select'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/portal/profile_client.rb:57:in `ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/portal/profile_client.rb:81:in `rescue in ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/portal/profile_client.rb:56:in `ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/profile_helper.rb:65:in `block in ensure_xcode_managed_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/profile_helper.rb:59:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/profile_helper.rb:59:in `ensure_xcode_managed_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/profile_helper.rb:40:in `block in ensure_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/profile_helper.rb:38:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/lib/autoprovision/profile_helper.rb:38:in `ensure_profiles'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise524216524/step_src/step.rb:90:in `<main>'

Not sure what this means

Support Mac Catalyst apps

Right now this step only creates iOS provisioning profiles. With Mac Catalyst it should be able to create provisioning profiles for macOS (Catalyst).

I have no idea how the step should be changed to accommodate this, but hope that someone has.

Update for Xcode 11.4

To run Xcode 11.4 projects xcodeproj 1.16.0 is needed, otherwise the following error happens:

[Xcodeproj] Unknown object version.
Error:
[Xcodeproj] Unknown object version.
Stacktrace (for debugging):
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcodeproj-1.12.0/lib/xcodeproj/project.rb:227:in `initialize_from_file'
/Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcodeproj-1.12.0/lib/xcodeproj/project.rb:112:in `open'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise371961506/step_src/lib/autoprovision/project_helper.rb:273:in `block in archivable_target_and_container_project'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise371961506/step_src/lib/autoprovision/project_helper.rb:263:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise371961506/step_src/lib/autoprovision/project_helper.rb:263:in `archivable_target_and_container_project'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise371961506/step_src/lib/autoprovision/project_helper.rb:298:in `block in read_scheme_archivable_target_and_container_project'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise371961506/step_src/lib/autoprovision/project_helper.rb:294:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise371961506/step_src/lib/autoprovision/project_helper.rb:294:in `read_scheme_archivable_target_and_container_project'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise371961506/step_src/lib/autoprovision/project_helper.rb:24:in `initialize'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise371961506/step_src/step.rb:43:in `new'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise371961506/step_src/step.rb:43:in `'

Failing with error "undefined method `casecmp' for nil:NilClass"

For one of my projects, I'm getting the following error when running this step.

Error:
undefined method `casecmp' for nil:NilClass
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:176:in `distribution_type_matches?'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:58:in `block in ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:57:in `select'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:57:in `ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:81:in `rescue in ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:56:in `ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:65:in `block in ensure_xcode_managed_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:59:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:59:in `ensure_xcode_managed_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:40:in `block in ensure_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:38:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:38:in `ensure_profiles'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/step.rb:90:in `<main>'

Full output for this step:

+------------------------------------------------------------------------------+

| (0) ios-auto-provision@1                                                     |
+------------------------------------------------------------------------------+
| id: ios-auto-provision                                                       |
| version: 1.5.3                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2020-08-26T19:19:31Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
Successfully installed bundler-1.17.3
Parsing documentation for bundler-1.17.3
Installing ri documentation for bundler-1.17.3
Done installing documentation for bundler after 4 seconds
1 gem installed
$ bundle install
$ bundle exec ruby /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/step.rb
Params:
team_id: XXXXXXXXXX
certificate_urls: ***
min_profile_days_valid: 0
passphrases: 
distribution_type: app-store
project_path: XXXXXXXXXX.xcodeproj
scheme: XXXXXXXXXX-Development
configuration: 
build_url: https://app.bitrise.io/build/7427e1e048936414
build_api_token: ***
keychain_path: /Users/vagrant/Library/Keychains/login.keychain
keychain_password: ***
verbose_log: no
generate_profiles: no
Developer Portal authentication
Session loaded from environment variable is not valid. Continuing with normal login.
authenticated
Downloading Certificates
1 certificate files downloaded, 1 distinct codesign identities included
Identify Certificates on Developer Portal
Distribution certificate found: Apple Distribution: XXXXXXXXXX
Analyzing project
project codesign identity: iPhone Developer
project team id: XXXXXXXXXX
uses xcode managed signing: true
main target's platform: 
target #0: XXXXXXXXXX with 3 services
Matching project codesign identity with the uploaded certificates
using: Apple Distribution: XXXXXXXXXX
Ensure Provisioning Profiles on Developer Portal
checking xcode managed app-store profile for target: XXXXXXXXXX with 3 services on developer portal
Error:
undefined method `casecmp' for nil:NilClass
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:176:in `distribution_type_matches?'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:58:in `block in ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:57:in `select'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:57:in `ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:81:in `rescue in ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/portal/profile_client.rb:56:in `ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:65:in `block in ensure_xcode_managed_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:59:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:59:in `ensure_xcode_managed_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:40:in `block in ensure_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:38:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/lib/autoprovision/profile_helper.rb:38:in `ensure_profiles'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise259213736/step_src/step.rb:90:in `<main>'
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision@1 (exit code: 1)                           | 1.1 min  |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision          |
+---+---------------------------------------------------------------+----------+

I have tried removing all provisioning profiles from the Apple Developer Portal, and generating new ones using fastlane, but that doesn't change anything. Automatic signing is enabled for this project.

Unable to retrieve tvOS app-store provisioning profile

When managing tvOS provisioning profiles using auto provision step, it is unable to download app-store profile for tvOS target.

Here you can see it downloads correct development profile, but it cannot find app-store profile:

Ensure Provisioning Profiles on Developer Portal
checking xcode managed development profile for target: Axis_tvOS (co.massive.axis.demo) with 1 services on developer portal
downloading development profile: tvOS Team Provisioning Profile: co.massive.axis.demo
checking xcode managed development profile for target: Axis_tvOS_topshelf (co.massive.axis.demo.topshelf) with 1 services on developer portal
downloading development profile: tvOS Team Provisioning Profile: co.massive.axis.demo.topshelf
checking xcode managed app-store profile for target: Axis_tvOS (co.massive.axis.demo) with 1 services on developer portal

Then it throws an error:

Error:
Failed to find app-store Xcode managed provisioning profile for bundle id: co.massive.axis.demo.

However, all 6 profiles (app-store, app-store topshelf etc) are created and uploaded to Bitrise.

Also when I set generate_profiles to yes, it always generate iOS provision profiles. Is it possible to make this step generate tvOS profiles so that we don't need to upload profiles manually.

Fails with private Swift Package

In my current setup I am using a Swift Package which is hosted privately on GitHub. I use another public Swift Package as well. When the step is running it fails when it tries to resolve the packages.

The following output is shown:

Analyzing project
xcodebuild: error: Could not resolve package dependencies:
  Authentication failed because no credentials were provided.
Error:
xcodebuild -showBuildSettings -project "/Users/vagrant/git/WatchSonos.xcodeproj" -target "WatchSonos" -configuration "Release" failed, out: Resolve Package Graph
Fetching https://github.com/ApolloZhu/swift_qrcodejs.git
Fetching https://github.com/Sn0wfreezeDev/private_package.git
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise043985305/step_src/lib/autoprovision/project_helper.rb:405:in `xcodebuild_target_build_settings'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise043985305/step_src/lib/autoprovision/project_helper.rb:325:in `target_codesign_identity'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise043985305/step_src/lib/autoprovision/project_helper.rb:83:in `block in project_codesign_identity'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise043985305/step_src/lib/autoprovision/project_helper.rb:80:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise043985305/step_src/lib/autoprovision/project_helper.rb:80:in `project_codesign_identity'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise043985305/step_src/step.rb:44:in `<main>'

I use a Bitrise SSH Key that has been added manually to my GitHub, but the Swift Packages use https for authentication which may be the issue, why it fails here.
Currently I have not found a method to add https authentication for this.

Kind regards
Alex

Error in certificate_common_name

I'm getting the error below. I have uploaded my distribution certificate.

Error:
undefined method subject' for nil:NilClass Stacktrace (for debugging): /private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise883594639/step_src/lib/autoprovision/utils.rb:2:in certificate_common_name'
/private/var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/bitrise883594639/step_src/lib/autoprovision/utils.rb:10:in `certificate_name_and_serial'

Error in latest version 1.5.6: undefined method map' for nil:NilClass

Troubleshooting

  • I've searched discuss.bitrise.io for possible solutions.
  • Which version of the step is effected? 1.5.6
  • Is the issue reproducible with the latest version? YES
  • Does the issue happen sporadically, or every time? EVERY TIME
  • Is the issue reproducible locally by following our local debug guide? YES

Issue description

The step failed with exit code 1. It's an "undefined method" error in profile_client.rb:230
I'm pretty sure this bug was introduced in the latest version that was released today. Version 1.5.5 works fine!

Bitrise info

Matching project codesign identity with the uploaded certificates
using: Apple Development: ***
using: Apple Distribution: ***

Ensure test devices on Developer Portal
No test devices registered on Bitrise.

Ensure Provisioning Profiles on Developer Portal
checking app for target: **** (****) on developer portal
Push Notifications already enabled
Associated Domains already enabled
Data Protection: complete already set
ensure development profile for target: **** on developer portal

Error:
undefined method map' for nil:NilClass Stacktrace (for debugging): /private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/portal/profile_client.rb:230:in device_list_up_to_date?'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/portal/profile_client.rb:108:in ensure_manual_profile' /private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/portal/profile_client.rb:116:in rescue in ensure_manual_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/portal/profile_client.rb:102:in ensure_manual_profile' /private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/profile_helper.rb:93:in block in ensure_manual_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/profile_helper.rb:81:in each' /private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/profile_helper.rb:81:in ensure_manual_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/profile_helper.rb:42:in block in ensure_profiles' /private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/profile_helper.rb:38:in each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/lib/autoprovision/profile_helper.rb:38:in ensure_profiles' /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise026350688/step_src/step.rb:91:in

'
| |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision (exit code: 1) | 2.2 min |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision |
+---+---------------------------------------------------------------+----------+

missing certificate_urls

We have an app with no uploaded certificates and are using this step to download them from Apple instead. We're getting an error though saying:

missing: certificate_urls

I assume this is a holdover from when this step used to rely on uploaded certificates, but it should be optional now though right?

Issue with missing project_path and scheme

Hi I'm having an issue with this step where the project_path is missing. If I manually specify the project_path instead of leaving as env variable like:
/Users/vagrant/git
Then it moves on to telling me that scheme is missing.

My workflow looks like:
Activate SSH key (RSA private key)
Git Clone Repository
Node Version Manager (NVM)
Run npm command
Ionic prepare
Script that runs cordova platform add ios
Cordova prepare
iOS Auto Provision

Is there something I am doing wrong here or this a possible bug? Can't find any information on this problem and wasn't sure where else to ask.

Permission denied while executing gem

Build Log:


| (6) [email protected]                                                 |
+------------------------------------------------------------------------------+
| id: ios-auto-provision                                                       |
| version: 1.5.2                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2020-03-12T03:43:14Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/CHANGELOG.md
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | [email protected] (exit code: 1)                       | 5.27 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision          |
+---+---------------------------------------------------------------+----------+

Sorry not giving much on the explanation as I no idea where to start fixing this. =(

Failing with error "undefined method `casecmp' for nil:NilClass"

I'm getting an error when running this step - any ideas what could be going wrong here?

Ensure Provisioning Profiles on Developer Portal
checking xcode managed development profile for target: co (com.company.co) with 1 services on developer portal
downloading development profile: iOS Team Provisioning Profile: com.company.co
checking xcode managed app-store profile for target: co (com.company.co) with 1 services on developer portal
Error:
undefined method `casecmp' for nil:NilClass
Stacktrace (for debugging):
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/portal/profile_client.rb:176:in `distribution_type_matches?'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/portal/profile_client.rb:58:in `block in ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/portal/profile_client.rb:57:in `select'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/portal/profile_client.rb:57:in `ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/portal/profile_client.rb:81:in `rescue in ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/portal/profile_client.rb:56:in `ensure_xcode_managed_profile'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/profile_helper.rb:65:in `block in ensure_xcode_managed_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/profile_helper.rb:59:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/profile_helper.rb:59:in `ensure_xcode_managed_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/profile_helper.rb:40:in `block in ensure_profiles'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/profile_helper.rb:38:in `each'
/private/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/lib/autoprovision/profile_helper.rb:38:in `ensure_profiles'
/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise715203356/step_src/step.rb:90:in `<main>'
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision (exit code: 1)                             | 41.93 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision          |
+---+---------------------------------------------------------------+----------+

step failing because bundler isn't up to date

Build log:

+------------------------------------------------------------------------------+

| (5) ios-auto-provision                                                       |
+------------------------------------------------------------------------------+
| id: ios-auto-provision                                                       |
| version: 1.5.0                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2020-01-10T09:05:42Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
$ bundle install
/Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.3) required by your /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/bitrise219760325/step_src/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
	from /Users/vagrant/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems.rb:294:in `activate_bin_path'
	from /Users/vagrant/.rbenv/versions/2.6.5/bin/bundle:23:in `<main>'
bundle install failed
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | ios-auto-provision (exit code: 1)                             | 5.59 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ...github.com/bitrise-steplib/steps-ios-auto-provision/issues |
| Source: https://github.com/bitrise-steplib/steps-ios-auto-provision          |
+---+---------------------------------------------------------------+----------+

I'm currently using the Xcode Edge stack, which has Bundler 2.1.2
https://github.com/bitrise-io/bitrise.io/blob/master/system_reports/osx-xcode-edge.log#L419

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.