Help Requested - Xcode project with multiple provisioning profiles fails archive and sign
See original GitHub issueHello @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:
- Created 5 years ago
- Comments:6
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
@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'