Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20916

Code Sign error: No matching provisioning profile found

      Regarding the issue yo opened here : https://issues.jenkins-ci.org/browse/JENKINS-20048

      I'm facing the same exact issue, appreciate your support if you were able to resolve this issue.

      My Error >>>>>>>>>>>>>>>>>>
      == Available provisioning profiles
      [workspace] $ /usr/bin/security find-identity -p codesigning -v
      1) 18C94576BC81E3FD5109803BCF46BCDBD8D05341 "iPhone Developer: Amr El-Dessouky (XNGHTZX727)"
      1 valid identities found
      == Available SDKs
      [workspace] $ /usr/bin/xcodebuild -showsdks
      OS X SDKs:
      OS X 10.8 -sdk macosx10.8
      OS X 10.9 -sdk macosx10.9
      iOS SDKs:
      iOS 7.0 -sdk iphoneos7.0
      iOS Simulator SDKs:
      Simulator - iOS 7.0 -sdk iphonesimulator7.0
      == Available schemes
      [workspace] $ /usr/bin/xcodebuild -list
      Information about project "iRAZ":
      Targets:
      iRAZ
      Build Configurations:
      Debug
      Release
      If no build configuration is specified and -scheme is not passed then "Release" is used.
      This project contains no schemes.
      ===========================================================
      Going to invoke xcodebuild:target: ALL, sdk: DEFAULT, project: DEFAULT, configuration: Release, clean: NO, archive:NO, symRoot: DEFAULT, configurationBuildDir: DEFAULT, codeSignIdentity: DEFAULT
      [workspace] $ /usr/bin/xcodebuild -alltargets -configuration Release build
      === BUILD TARGET iRAZ OF PROJECT iRAZ WITH CONFIGURATION Release ===
      Check dependencies
      Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID ���9493A4CE-08F9-47CC-885B-17FCD0DFD1EA���, however, no such provisioning profile was found.
      CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0'

        • BUILD FAILED **

          [JENKINS-20916] Code Sign error: No matching provisioning profile found

          Cesar Carrasco added a comment - - edited

          I was able to overcome this by using the Keychains and Provisioning Profiles Plugin. Perhaps this can be made a dependency on this one?

          Cesar Carrasco added a comment - - edited I was able to overcome this by using the Keychains and Provisioning Profiles Plugin . Perhaps this can be made a dependency on this one?

          Rajesh N added a comment -

          I still have the problem. Can you please help me in solving this issue. Thanks in Advance.

          Rajesh N added a comment - I still have the problem. Can you please help me in solving this issue. Thanks in Advance.

          Hello,

          I was able to solve this issue, which was due to two main reasons, Xcode when invoked from Jenkins looks to ite resources from the System & not the user, so to fix at least get sure that you did the following:-

          1-Ensure the project is building successfully from Xcode to real target.

          -In KeyChain

          2-Copy all the development cretificates & credentials form your user folder to the system folder

          3-Copy all the Provisioning profiles existing in

          Users/<user>/Library/MobileDevice/Provisioning Profiles

          to

          System/Library/MobileDevice/Provisioning Profiles

          Create the missing folders if they don’t exist below 'Library'

          Amr El-Dessouky added a comment - Hello, I was able to solve this issue, which was due to two main reasons, Xcode when invoked from Jenkins looks to ite resources from the System & not the user, so to fix at least get sure that you did the following:- 1-Ensure the project is building successfully from Xcode to real target. -In KeyChain 2-Copy all the development cretificates & credentials form your user folder to the system folder 3-Copy all the Provisioning profiles existing in Users/<user>/Library/MobileDevice/Provisioning Profiles to System/Library/MobileDevice/Provisioning Profiles Create the missing folders if they don’t exist below 'Library'

          andrew stevko added a comment -

          This is blocking me as well.

          My test job consists of

          • Import developer profile
          • Execute shell
            security -v find-certificate -a
            security -v find-identity -p codesigning

          I've exported/imported the developerprofile from xcode into jenkins.
          I've copied my ~/Library/Keychains/* into /System/Library/Keychains/
          I've copied my ~/Library/MobileDevice/Provisioning\ Profiles/* into /System/Library/MobileDevice/Provisioning\ Profiles/

          The console shows successful create-keychain, unlock-keychain, 3 import mobileprovision (from the profile), 5 installing mobileprovisions (from the System Provisioning Profiles).

          The find-certificate shows only System.keychain certs.
          The find-identity codesigning always returns 0 identities found.

          Also - the job does not clean up after itself even tho "restore keychains as defined in global configuration" is checked. It will error on create-keychain on the second run.

          andrew stevko added a comment - This is blocking me as well. My test job consists of Import developer profile Execute shell security -v find-certificate -a security -v find-identity -p codesigning I've exported/imported the developerprofile from xcode into jenkins. I've copied my ~/Library/Keychains/* into /System/Library/Keychains/ I've copied my ~/Library/MobileDevice/Provisioning\ Profiles/* into /System/Library/MobileDevice/Provisioning\ Profiles/ The console shows successful create-keychain, unlock-keychain, 3 import mobileprovision (from the profile), 5 installing mobileprovisions (from the System Provisioning Profiles). The find-certificate shows only System.keychain certs. The find-identity codesigning always returns 0 identities found. Also - the job does not clean up after itself even tho "restore keychains as defined in global configuration" is checked. It will error on create-keychain on the second run.

          Luis Placid added a comment -

          I was also having this issue. I just resolved via the following:

          1. Open Xcode 5.0 -> Preferences -> Accounts and delete your developer account.
          2.Navigate to the path where your Jenkins exists, In my case its '/Users/Shared/Jenkins/Library/MobileDevice/Provisioning Profiles' and delete all cached provisioning profiles there. Usually Xcode stores it under '/Users/<USERNAME>/Library/MobileDevice/Provisioning Profiles/'
          3. Open Xcode -> preferences -> Accounts: re-add your developer account
          4. Open your Jenkins job's configuration page, navigate to your Xcode step and check the values under the 'Code signing & OS X keychain options'. Make sure the Code Signing identity value matches the identity found on your keychain.
          5. ?????
          6. Build & make profit.

          Hope it works

          Luis Placid added a comment - I was also having this issue. I just resolved via the following: 1. Open Xcode 5.0 -> Preferences -> Accounts and delete your developer account. 2.Navigate to the path where your Jenkins exists, In my case its '/Users/Shared/Jenkins/Library/MobileDevice/Provisioning Profiles' and delete all cached provisioning profiles there. Usually Xcode stores it under '/Users/<USERNAME>/Library/MobileDevice/Provisioning Profiles/' 3. Open Xcode -> preferences -> Accounts: re-add your developer account 4. Open your Jenkins job's configuration page, navigate to your Xcode step and check the values under the 'Code signing & OS X keychain options'. Make sure the Code Signing identity value matches the identity found on your keychain. 5. ????? 6. Build & make profit. Hope it works

          Tom Hicks added a comment -

          "restore keychains as defined in global configuration" doesn't work for me I had to add a shell task 'security delete-keychain "jenkins-$JOB_NAME" || :' to delete the keychain if it existed before.

          I also added an "Import developer profile" task and put my *.developerprofile file in the credentials system.

          I still couldn't sign and a shell task would show no code signing keys present, because the keys aren't imported into the login.keychain keychain.

          You need to also expand "Code signing & OS X keychain options", check "Unlock Keychain?" and fill in the path to the keychain file ie "${HOME}/Library/Keychains/jenkins-${JOB_NAME}" and the password you used for the *.developerprofile file as the Keychain password.

          Tom Hicks added a comment - "restore keychains as defined in global configuration" doesn't work for me I had to add a shell task 'security delete-keychain "jenkins-$JOB_NAME" || :' to delete the keychain if it existed before. I also added an "Import developer profile" task and put my *.developerprofile file in the credentials system. I still couldn't sign and a shell task would show no code signing keys present, because the keys aren't imported into the login.keychain keychain. You need to also expand "Code signing & OS X keychain options", check "Unlock Keychain?" and fill in the path to the keychain file ie "${HOME}/Library/Keychains/jenkins-${JOB_NAME}" and the password you used for the *.developerprofile file as the Keychain password.

          Only thing I found to make it work is manually specifying provisioning profile as custom xcodebuild arguments:

          1. Add Execute shell step before Xcode and place this:

          echo "PROVISIONING_ID=`/usr/libexec/PlistBuddy -c 'Print UUID' /dev/stdin <<< $(security cms -D -i ${WORKSPACE}/Resources/profile.mobileprovision)`" > env.properties

          (fix the path to provisioning file)

          2. Add Inject environment variables step after Execute shell step and set Properties File Path to env.properties

          3. In Xcode step, click Settings, then Advanced build settings... and fill Custom xcodebuild arguments with:

          PROVISIONING_PROFILE=${PROVISIONING_ID}

          Wojtek Siudzinski added a comment - Only thing I found to make it work is manually specifying provisioning profile as custom xcodebuild arguments: 1. Add Execute shell step before Xcode and place this: echo "PROVISIONING_ID=`/usr/libexec/PlistBuddy -c 'Print UUID' /dev/stdin <<< $(security cms -D -i ${WORKSPACE}/Resources/profile.mobileprovision)`" > env.properties (fix the path to provisioning file) 2. Add Inject environment variables step after Execute shell step and set Properties File Path to env.properties 3. In Xcode step, click Settings , then Advanced build settings... and fill Custom xcodebuild arguments with: PROVISIONING_PROFILE=${PROVISIONING_ID}

          Nitin Malik added a comment -

          We found that specifying a path for an embedding a profile was not working and xcode is probably looking at the regular place where provisioning profiles are found.

          To solve our issue, we removed all the provisioning profiles from the computer. Then installed the missing provisioning profile by double clicking on it.

          Also ensure that you specify the correct provisioning profile in your xcode build settings.

          Nitin Malik added a comment - We found that specifying a path for an embedding a profile was not working and xcode is probably looking at the regular place where provisioning profiles are found. To solve our issue, we removed all the provisioning profiles from the computer. Then installed the missing provisioning profile by double clicking on it. Also ensure that you specify the correct provisioning profile in your xcode build settings.

          Paul Eipper added a comment - See https://issues.jenkins-ci.org/browse/JENKINS-30979 And https://stackoverflow.com/questions/25637472/jenkins-ios-build-using-credentials-and-developer-profile

            Unassigned Unassigned
            amrsd Amr El-Dessouky
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: