Issue when trying to build Xamarin.iOS project that includes Extension project
See original GitHub issueRequired Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: BUG
Enter Task Name: InstallAppleProvisioningProfile
list here (V# not needed):
https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/InstallAppleProvisioningProfileV1/installprovprofile.ts
Environment
-
Server - Azure Pipelines or TFS on-premises?
-Azure Pipelines
-
Agent - Hosted or Private:
- Hosted
Issue Description
Hi,
I’m trying to set up my first Azure Pipelines project. This is for a Xamarin.Forms project. To make things simpler, since I know they have very different build steps, I’m splitting this into two different pipelines, one for the iOS project and one for the Android project.
The iOS project contains a Today Extension. On an iPhone, if you swipe to the right from the main home screen, you get a bunch of widgets that can be configured. These provide on-demand information without having to launch the related app. Although they are a separate project within your VS solution, behind the scenes (this is my understanding), the extension projects, since they are bundled with the iOS application, are automatically built when the iOS project is built.
My YAML configuration is attached. I uploaded the provisioning profiles for the iOS application as well as the Today extension (each one has their own separate provisioning profile). I added two separate InstallAppleProvisioningProfile tasks to the YAML, however, during the build step it errored out saying that it couldn’t find the provisioning profile for the extension project. It actually depended on which profile install step was “last.” I read in the comments for the source code for that step:
// If there are multiple InstallAppleCertificate tasks, the last one wins. tl.setVariable('APPLE_PROV_PROFILE_UUID', info.provProfileUUID);
Given the above, I’m not sure how you would go about referencing a second provisioning profile. Additionally, in the Xamarin.IOS
build step, I don’t know (or they don’t exist) how to set the configuration options to tell the compiler which provisioning profile to use when building which project. This may be something that has to be gleaned from the Xamarin tools team.
So, to sum up, I’m looking for a way to use Azure Pipelines to build a Xamarin.iOS project which includes a related App Extensions project (in my case, a Today Extension).
Here’s a link about Extensions in Xamarin if helpful: https://docs.microsoft.com/en-us/xamarin/ios/platform/extensions
Task logs
"/Users/vsts/agent/2.153.2/work/1/s/iOS/org.iOS.csproj" (default target) (1) -> "/Users/vsts/agent/2.153.2/work/1/s/HospitalStatus/HospitalStatus.csproj" (default target) (3) -> (_DetectSigningIdentity target) -> Info.plist : error : Project bundle identifier 'com.org.HospitalStatus' does not match specified provisioning profile '3e3246e6-8de4-43bd-b15d-e7a6cfa41e7d' [/Users/vsts/agent/2.153.2/work/1/s/HospitalStatus/HospitalStatus.csproj]
Troubleshooting
Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
Error logs
(included in task log above)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Hello, @Osmosis311!
At the moment the current implementation of the XamariniOS task doesn’t support builds where several provisioning profiles needed. We already created a ticket regarding this XamariniOS task enhancement.
As a workaround, you can specify names of provisioning profiles in settings of your projects (
Project Settings -> iOS Bundle Signing -> Provisioning Profile
) instead of using the automatic option. That’s must be done for app and extension as well. After that you could leavesigningIdentity
andsigningProvisioningProfileID
fields empty for XamariniOS@2 task in YAML file. Since names of provisioning profiles were already specified in projects, the XamariniOS task is able to sign in an app with the extension using specified provisioning profiles.I assume the correct YAML file will be looking like this:
The workaround recommended by @alexander-smolyakov for removing the optional Signing Identity and Provisioning Profile from the DevOps task configuration worked for me. As these were identified in the .csproj for both the iOS app and the extension, the build correctly picked up the installed profile accordingly.