简体   繁体   中英

How do I get my fastlane build (gym) with multiple targets to find my provisioning profiles

My Fastfile:

lane :build do |options|
    match(
      app_identifier: [
         ENV['IOS_APP_ID'], 
         ENV['SIRI_BUNDLE_ID'], 
         ENV['PUSH_INTERCEPTOR_BUNDLE_ID'], 
         ENV['WIDGETS_BUNDLE_ID']
      ],
      shallow_clone: true,
      clone_branch_directly: true,
      readonly: true
    )
    update_code_signing_settings(
      use_automatic_signing: false,
      path: xcodeproj,
      targets: ios_target_names
    )

    gymOptions = ({
      silent: true,
      export_team_id: ENV['IOS_TEAM_ID'],
      export_options: {
        signingStyle: "manual",
        provisioningProfiles: { 
          ENV['IOS_APP_ID'] => "match AdHoc #{ENV['IOS_APP_ID']}",                                                   
          ENV['SIRI_BUNDLE_ID'] => "match AdHoc #{ENV['SIRI_BUNDLE_ID']}",
          ENV['PUSH_INTERCEPTOR_BUNDLE_ID'] => "match AdHoc #{ENV['PUSH_INTERCEPTOR_BUNDLE_ID']}",
          ENV['WIDGETS_BUNDLE_ID'] => "match AdHoc #{ENV['WIDGETS_BUNDLE_ID']}"
        }
      }
    }).merge(
      File.directory?("../#{xcworkspace}") ?
        {workspace: xcworkspace} :
        {project: xcodeproj}
    )
    gym(gymOptions)

From the output, it looks like everything is set up correctly:

|                                         Installed Provisioning Profile                                          |
+---------------------+---------------------------------------------+---------------------------------------------+
| Parameter           | Environment Variable                        | Value                                       |
+---------------------+---------------------------------------------+---------------------------------------------+
| App Identifier      |                                             | com.company.app.SiriAction          |
| Type                |                                             | adhoc                                       |
| Platform            |                                             | ios                                         |
| Profile UUID        | sigh_com.company.app.SiriAction_ad  | exxxxxx-1xxxx-4xxx-bxxx-7xxxxxxx        |
|                     | hoc                                         |                                             |
| Profile Name        | sigh_com.company.app.SiriAction_ad  | match AdHoc                                 |
|                     | hoc_profile-name                            | com.company.app.SiriAction          |
| Profile Path        | sigh_com.company.app.SiriAction_ad  | /Users/myuser/Library/MobileDevice/Pro  |
|                     | hoc_profile-path                            | visioning                                   |
|                     |                                             | Profiles/exxxxxx-1xxxx-4xxx-bxxx-7xxxxxxx  |
|                     |                                             | 6a8.mobileprovision                         |
| Development Team ID | sigh_com.company.app.SiriAction_ad  | 38XXXXXXXX                                  |
|                     | hoc_team-id                                 |                                             |
+---------------------+---------------------------------------------+---------------------------------------------+
// This repeats for each provisioning profile...



+---------------------------------------------------------------------+---------------------------------------------------------------+
|                                                       Summary for gym 2.206.2                                                       |
+---------------------------------------------------------------------+---------------------------------------------------------------+
| silent                                                              | true                                                          |
| export_team_id                                                      | 38XXXXXXXX                                                    |
| export_options.signingStyle                                         | manual                                                        |
| export_options.provisioningProfiles.com.company.app.staging       | match AdHoc com.company.app.staging                         |
| export_options.provisioningProfiles.com.company.app.SiriAc  | match AdHoc com.company.app.SiriAction                |
| tion                                                                |                                                               |
| export_options.provisioningProfiles.com.company.app.PushIntercep  | match AdHoc com.company.app.PushInterceptor                 |
| tor                                                                 |                                                               |
| export_options.provisioningProfiles.com.company.app.Widgets       | match AdHoc com.company.app.Widgets                         |
| workspace                                                           | ios/app.xcworkspace                                          |
| export_method                                                       | ad-hoc                                                        |
| scheme                                                              | app                                                          |
| clean                                                               | false                                                         |
| output_directory                                                    | dist                                                          |
| output_name                                                         | app                                                           |
| skip_package_ipa                                                    | false                                                         |
| skip_package_pkg                                                    | false                                                         |
| build_path                                                          | /Users/myuser/Library/Developer/Xcode/Archives/2022-06-24 |
| result_bundle                                                       | false                                                         |
| buildlog_path                                                       | ~/Library/Logs/gym                                            |
| destination                                                         | generic/platform=iOS                                          |
| xcodebuild_formatter                                                | xcpretty                                                      |
| skip_profile_detection                                              | false                                                         |
| xcodebuild_command                                                  | xcodebuild                                                    |
| skip_package_dependencies_resolution                                | false                                                         |
| disable_package_automatic_updates                                   | false                                                         |
| use_system_scm                                                      | false                                                         |
| xcode_path                                                          | /Applications/Xcode.app                                       |
+---------------------------------------------------------------------+---------------------------------------------------------------+

But then I get errors saying it can't find the certificates:

[12:22:16]: ▸ ❌  error: "PushInterceptor" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'PushInterceptor' from project 'app')
[12:22:16]: ▸ ❌  error: "SiriAction" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'SiriAction' from project 'app')
[12:22:16]: ▸ ❌  error: "WidgetsExtension" requires a provisioning profile with the App Groups feature. Select a provisioning profile in the Signing & Capabilities editor. (in target 'WidgetsExtension' from project 'app')
[12:22:16]: ▸ ❌  error: "app" requires a provisioning profile with the Associated Domains, Siri, In-App Purchase, App Groups, Sign in with Apple, and Push Notifications features. Select a provisioning profile in the Signing & Capabilities editor. (in target 'app' from project 'app')

I have checked the capabilities are correct for each cert in the Apple developer portal, and tried every combination of answers I can find for similar issues.

This output suggests everything is correct right? Is there anything I can do to debug further or correct the configuration?

It seems as though I don't have the provisioning profiles locally, or I'm not pointing to them correctly. Any other ideas?

setting these options might help. update_project_provisioning and update_project_provisioning

install_provisioning_profile(
  path: "profilename.mobileprovision"
)
update_project_provisioning(
  xcodeproj: "Project.xcodeproj",
  profile: "./watch_app_store.mobileprovision", # optional if you use sigh
  target_filter: ".*WatchKit Extension.*", # matches name or type of a target
  build_configuration: "Release",
  code_signing_identity: "iPhone Development" # optionally specify the codesigning identity
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM