Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Code Signing Error: No signing certificate "iOS Development" found

Discussion in 'iOS and tvOS' started by Tritina, Feb 21, 2020.

  1. Tritina

    Tritina

    Joined:
    Jan 22, 2018
    Posts:
    3
    Hello Everyone,

    I would like to configure our CI Jenkins Build to sign our iOS App for development / distribution

    After many days of research and confusion about the Apple signing process this is what I got:
    A valid provisioning profile and a valid Signing certificate.
    The Unity build output produces a xcodeproject.

    In the XCodeProject the settings for:

    Unity-IPhone --> Build-Settings --> Signing --> Code Signing Identity:

    magically get set to "iOS Development" every time after the unity build completes

    I do both:

    1) setup the xcode project in a post build action:
    pBXProject.SetBuildProperty(mainTargetId, "CODE_SIGN_IDENTITY", config.SigningCertificateName );
    pBXProject.SetBuildProperty(mainTargetId, "CODE_SIGN_STYLE", "Manual");

    as well as

    2) calling xcodebuild from the console using:

    xcodeBuild xcodeSchema: 'Unity-iPhone', ... jada jada ... , xcodebuildArguments: 'ENABLE_BITCODE=NO PROVISIONING_PROFILE=<The Guid of our provisioning profile> CODE_SIGN_IDENTITY="<The name of our Code signing certificate>" CODE_SIGN_STYLE="Manual"'

    but still the CODE_SIGN_IDENTITY gets replaced by "iOS Development", which is not even installed on the mac. The provisioning profile and signing certificates available on the mac are only the ones used above.
    I deleted all the others.

    If I manually change the signing certificate to the one that should be used in xcode, I can archive export and install the app.

    I just don't understand how the certificate gets messed up all the time.

    Does someone have an idea how to fix this issue?

    Any information would be appreciated.

    Best Jochen
     
  2. mit-koyata

    mit-koyata

    Joined:
    Nov 1, 2016
    Posts:
    1
    I have the same problem.

    In my case, when I opened the Xcode project and checked Build Settings > Code Signing Identify, I found that the release was "iOS Developer". So I've avoided this by changing it to "iOS distribution" in a Unity script.
    Of course, this is only a temporary solution until the root cause is found.

    Code (CSharp):
    1. public void OnPostprocessBuild(BuildReport report) {
    2.     var summary = report.summary;
    3.     if(summary.platformGroup != BuildTargetGroup.iOS) {
    4.         return;
    5.     }
    6.  
    7.     var pbxPath = summary.outputPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
    8.     var project = new PBXProject();
    9.     project.ReadFromFile(pbxPath);
    10.  
    11.     var targetGuid = project.GetUnityMainTargetGuid();
    12.     var releaseConfig = project.BuildConfigByName(targetGuid, "Release");
    13.     project.SetBuildPropertyForConfig(releaseConfig, "CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Distribution");
    14.  
    15.     project.WriteToFile(pbxPath);
    16. }
     
    marllon_helloello likes this.
  3. _creatio_

    _creatio_

    Joined:
    Mar 21, 2013
    Posts:
    43
    I was able to solve this problem with setting the type of the provisioning profile in Unity:
    Code (CSharp):
    1. if (args.isAppStoreBuild)
    2. {
    3.    PlayerSettings.iOS.iOSManualProvisioningProfileType = ProvisioningProfileType.Distribution;
    4. }
    5. else
    6. {
    7.     PlayerSettings.iOS.iOSManualProvisioningProfileType = ProvisioningProfileType.Development;
    8. }
    By default iOSManualProvisioningProfileType == Automatic (you can find it in PlayerSettings), but for some reason it works incorrectly in some cases. So forcing it that way - helps.
     
    marllon_helloello likes this.