question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Help Requested - Xcode project with multiple provisioning profiles fails archive and sign

See original GitHub issue

Hello @madhurig & @bryanmacfarlane,

I’m new to DevOps so please go easy on me if I’ve missed something basic 😃

I’m using the following: -Hosted MacOS with an Xcode Build Agent (Xcode Version 5.142.0)

I’ve just started trying to set up a pipeline for an Xcode based project which uses multiple provisioning profiles. In my scenario I have profiles for the following in my app:

  • Intents
  • ItentsUI
  • Widget
  • App

I’ve followed the instructions for setting up certs and provisioning profiles here (although my project uses automatic signing): https://docs.microsoft.com/en-us/azure/devops/pipelines/apps/mobile/app-signing?view=vsts&tabs=apple-install-during-build

These are being installed correctly to a hosted build agent (no errors) and the build is proceeding perfectly until signing.

During signing it seems that the none of the targets can find their provisioning profiles (both when using ‘manual’ or ‘default’ (nothing entered) assignment).

Here’s whats run in the logs:

[command]/usr/bin/xcodebuild -workspace /Users/vsts/agent/2.142.1/work/1/s/*MYAPP**.xcworkspace -scheme **MYAPP** archive -sdk iphoneos -configuration Release -archivePath /Users/vsts/agent/2.142.1/work/1/s/**MYAPP** CODE_SIGN_STYLE=Manual PROVISIONING_PROFILE= PROVISIONING_PROFILE_SPECIFIER= | /usr/local/bin/xcpretty --no-color

Then later when it comes to archiving the following for each scheme:

error: "xxx Today Widget" requires a provisioning profile with the Push Notifications and App Groups features. Select a provisioning profile for the "Release" build configuration in the project editor. (in target 'xxx Today Widget')

A few questions:

1.) Is there an updated guide for this that I can follow for my use case (can’t help but wonder if I’m missing something as this seems a fairly common need).

2.) Alternatively is there a way to force which profile gets used for which scheme when archiving and signing?

3.) Is automatic signing possibly supported (or is this in the backlog)? I think this is something which most of us now take as a given when building locally or using tools like Fastlane for build and distribution.

For completeness I’ve seen what looks like a somewhat similar issue here: https://github.com/Microsoft/azure-pipelines-tasks/issues/964 but it’s been closed for more than two years.

Thanks for taking a look guys!

Andrew

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
alombardcommented, Nov 9, 2018

Hi Folks - it turns out after closer inspection the development certificate I had been using was the wrong one (there were a few on my Mac). I swapped this for the appropriate version and the issues went away.

I can now successfully build, archive and sign.

Hopefully this helps someone.

Andrew

1reaction
TheRealLenoncommented, Dec 6, 2021

@alombard did u also faced the issue when using multiple schemes (not referring to different in the same run), that it is not using the defined variables or bundle extension?

For example I´m having an scheme “testing” and “prod” (where prod is the default) on an flutter app.

When now specifying the scheme “testing” as followed, the debug will output Building com.company.appname$(COMPANIES_APP_BUNDLE_EXT) for device (ios-release)...

And the archiving (creating the IPA) will have the error output: error: Provisioning profile "AppName-TEST - AppStore" has app ID "com.mycompany.application.test", which does not match the bundle ID "com.mycompany.application". (in target 'Runner' from project 'Runner')

Here is the archiving configuration within the pipeline:

- task: Xcode@5 displayName: 'Create IPA' inputs: actions: 'archive' scheme: 'testing' sdk: 'iphoneos' packageApp: true configuration: 'release' workingDirectory: 'ios' exportOptions: 'auto' exportMethod: 'ad-hoc' exportTeamId: '$(APPLETEAMID)' provisioningProfileUuid: $(APPLE_PROV_PROFILE_UUID) signingOption: 'manual' signingIdentity: $(APPLE_CERTIFICATE_SIGNING_IDENTITY) archivePath: 'ios/build/Runner.xcarchive' exportPath: 'ios/build' teamId: '$(APPLETEAMID)' xcWorkspacePath: 'ios/Runner.xcworkspace' args: '-verbose'

Read more comments on GitHub >

github_iconTop Results From Across the Web

xcodebuild -exportArchive fails for developer-id signed app
This command has code signing issues with Xcode 13, where apparently a communication with Apple failed. The command is executed on macOS 12.0...
Read more >
Azure Devops Pipelines - Xcode project with multiple ...
During signing it seems that the none of the targets can find their provisioning profiles (both when using 'manual' and 'automatic' assignment).
Read more >
How to add multiple provisioning profile for Xcode in azure ...
Hi I am new to Devops , I am making CI for my mobile application , it contains Appclip it is like same...
Read more >
Xcode 14 beta code signing issues when SPM targets include ...
Set the provisioning profile value to "Automatic" in the build settings editor. AFAICS, the only way forward is to avoid any codesigning ...
Read more >
Code signing issues in Xcode 14 and how to fix them
Another issue arising with the release of Xcode 14 has to do with the conflicting provisioning profiles. This problem is plaguing projects ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found