AaronDS
AaronDS

Reputation: 861

Why does provisioning profile need to be set to distribution for both debug and release?

I'm attempting to build my react native app via fastlane on CircleCI. I'm using match for managing certificates/profiles and using these guides:

fastlane ios beta works locally.

On CI however, I found the setup failed to build, with the following error:

error: No profile for team '...' matching 'match Development app.my' found: Xcode couldn't find any provisioning profiles matching '.../match Development app.my'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the Signing & Capabilities tab of the target editor. (in target 'MyApp' from project 'MyApp')`

I thought this was strange, because I'm not using the development profile for my build, but instead the distribution profile. This is confirmed in the build output when match/gym are invoked, where there is no mention of the development profile.

In Xcode, under "Signing & Capabilities", I had "automatically manage signing" unticked as per the above guides, with "debug" set to use the development provisioning profile, with "release" set to use the distribution profile.

Changing the provisioning profile to "release" under the "debug" section was what fixed my CI builds, but why is this? Surely my debug builds should always use a development certificate?

Upvotes: 0

Views: 1163

Answers (1)

Nick
Nick

Reputation: 522

I was having a similar issue with my iOS build and finally realized I needed to match the profile in Xcode to the profile in my Fastfile:

lane :beta do
  begin
    build_number = increment_build_number(...)
    slack(message: "Starting new build " + build_number)

    *** match(type: "appstore") ***

    build_app(
      ...

      *** export_method: "app-store", ***

      build_path: "./builds",
      output_directory: "./builds"
    )
    upload_to_testflight(
      skip_waiting_for_build_processing: true
    )

    slack(
      message: "App successfully published to TestFlight"
    )

  end

Match will download the needed profile to the machine, but if the "Provisioning Profile" (Found in Build Settings -> Signing) in Xcode doesn't match the Fastfile, Xcode won't have what it needs from Match.

Upvotes: 0

Related Questions