Azure-pipelines-tasks: Xcode@5 Code Signing Error when building a project with embedded framework that does not support manual signing

Created on 30 Jan 2020  Â·  12Comments  Â·  Source: microsoft/azure-pipelines-tasks

Required Information

Type: Bug
Task Name: Xcode@5

Environment

All

Issue Description

Xcode@5 fails to build an Xcode project that has multiple targets that have mixed signing needs, resulting in a Code Signing Error with this format:

<Framework> does not support provisioning profiles. <Framework> does not support provisioning profiles, but provisioning profile <Provisioning Profile Name> has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor.

In my case, I am trying to build an Xcode project produced by Unity 2019.3, which includes a new UnityFramework that does not support manual code signing.

According to the Unity Documentation, a new set of command line arguments for xcodebuild are to be used to target manual code signing to the main Unity-iPhone target only, and leave UnityFramework to be able to signed automatically.

Using PROVISIONING_PROFILE_APP and PROVISIONING_PROFILE_SPECIFIER_APP instead of PROVISIONING_PROFILE and PROVISIONING_PROFILE_SPECIFIER in the xcodebuild command fixes this issue.

Adding a "Custom Provisioning Profile Argument Suffix" parameter to Xcode under the Signing action would allow this issue to be fixed. See this blob post for more information about how the suffixes are used in building Xcode projects with multiple targets.

Here is a Unity produced Xcode project that can be used to demonstrate the issue:

https://content-infrastructure-uploadbucket-iuhbmg0o97e6.s3.amazonaws.com/uploads/AzureXcodeCodeSignError.zip

You can attempt to build it using a command similar to this:

/usr/bin/xcodebuild -sdk iphoneos13.2 -configuration Release -project ./Unity-iPhone.xcodeproj -scheme Unity-iPhone archive CODE_SIGN_STYLE=Manual CODE_SIGN_IDENTITY="<Code Sign Identity>" PROVISIONING_PROFILE_APP="<Provisioning Profile UUID>" PROVISIONING_PROFILE_SPECIFIER_APP="<Provisioning Profile Name>"
CrossPlatform bug

Most helpful comment

@pandey-laxman, sorry missed this email!

It needs to go in the arguments field in the Xcode task.
This is how my Xcode task looks (in yaml):

          - task: Xcode@5
            inputs:
              actions: 'build'
              xcWorkspacePath: '**/myproj.xcworkspace'
              scheme: 'myproj'
              xcodeVersion: 'specifyPath'
              xcodeDeveloperDir: '/Applications/Xcode_11.1.app'
              packageApp: true
              exportPath: 'output/$(SDK)/$(BuildConfiguration)'
              exportOptions: 'plist'
              exportOptionsPlist: 'pipelines/export.debug.plist'
              signingOption: 'manual'
              signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
              provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
              args: 'CODE_SIGNING_ALLOWED=No'

All 12 comments

Hi @ericallam did u find any solution?

I manage to solve this by creating a custom task to provide "Custom Provisioning Profile Argument Suffix" to the Xcode Build task. If anyone wants the task let me know so I can share it.

Cheers.

Hi @fortunacio,
I'm getting the same problem as this with my Ionic project, could you share what you did to make it sign and build?
Thanks,
Paul

Yes, for sure, can you give me the name of your organization so I can share
the task?

El jue., 16 de abril de 2020 12:05 p. m., Paul-ICS notifications@github.com
escribió:

Hi @fortunacio https://github.com/fortunacio,
I'm getting the same problem as this with my Ionic project, could you
share what you did to make it sign and build?
Thanks,
Paul

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/azure-pipelines-tasks/issues/12263#issuecomment-614710619,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACAW2STG3MYNLFQOJLP5VZLRM4NEPANCNFSM4KNWN6QQ
.

My DevOps org is called: ics-development

Thanks,
Paul

Done. if u are using YAML pipeline u need to replace the Xcode@5 task for
the new one
(Wololo.build-release-wololo-task.custom-build-release-task.WololoBuild@0)
which has exactly the same functionality but with a new input
(provisioningProfileSuffix) so for use it u need to fill the suffix under
input task section, eg (provisioningProfileSuffix: APP).
if u are using the classic visual editor u can find the extension under the
Utility tab and the provisioningProfileSuffix option under Advance options
of the task.
Cheers, Federico.

El jue., 16 abr. 2020 a las 13:50, Paul-ICS (notifications@github.com)
escribió:

My DevOps org is called: ics-development

Thanks,
Paul

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/azure-pipelines-tasks/issues/12263#issuecomment-614769419,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACAW2STYT3XOKGWOLZXKIBLRM4ZNJANCNFSM4KNWN6QQ
.

Just a quick update, we tried your task and specified the suffix of APP, but it didn't seem to make any difference to the build. I also tried it locally and couldn't get xcodebuild to do anything with PROVISIONING_PROFILE_APP. It did the same as if it wasn't specified.

Anyway, we found that using the original Xcode build task and specifying an argument of "CODE_SIGNING_ALLOWED=No" made it all build and sign correctly.

Thanks for you help.

@Paul-ICS can you please be more specific about where you specified "CODE_SIGNING_ALLOWED=No" . is it in task: Xcode@5 ? on somewhere in xcode project.
I have some embedded framework for those getting below error.

error: Domain does not support provisioning profiles. Domain does not support provisioning profiles, but provisioning profile xxxxx has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'Domain' from project 'xxxxx')

Can you please provide more details to fix this issue?
I have been spent hours to fix this issue but still no luck.

@pandey-laxman, sorry missed this email!

It needs to go in the arguments field in the Xcode task.
This is how my Xcode task looks (in yaml):

          - task: Xcode@5
            inputs:
              actions: 'build'
              xcWorkspacePath: '**/myproj.xcworkspace'
              scheme: 'myproj'
              xcodeVersion: 'specifyPath'
              xcodeDeveloperDir: '/Applications/Xcode_11.1.app'
              packageApp: true
              exportPath: 'output/$(SDK)/$(BuildConfiguration)'
              exportOptions: 'plist'
              exportOptionsPlist: 'pipelines/export.debug.plist'
              signingOption: 'manual'
              signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
              provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
              args: 'CODE_SIGNING_ALLOWED=No'

@Paul-ICS Thank you very much, it worked I have created exportOptions.plist file in provided in above path and it worked.
But I have some doubts if you anyone can clear will highly be appreciated.

  1. what/how would be the workflow for app build(every PR merge) / distribute(on specific Tag) for different environment those are created configuration(dev, demo, qa and prod) for adhoc and App store.
  2. how to push release notes ?

there is no documentation I have found regarding this.

Does anyone know why "CODE_SIGNING_ALLOWED=No" works? I can't find any docs regarding this. (I used this for automating iOS builds for Unity 2020 via Jenkins).

For me, CODE_SIGNING_ALLOWED=No allowed my build to complete, but I couldn't use the resulting app because it wasn't signed. So, I don't believe that's a good solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

montebhoover picture montebhoover  Â·  3Comments

jared-hexagon picture jared-hexagon  Â·  3Comments

MikahB picture MikahB  Â·  3Comments

alexszilagyi picture alexszilagyi  Â·  3Comments

timfish picture timfish  Â·  3Comments