Search Unity

iOS Unity Cloud Build fails error: Provisioning profile doesn't match the entitlements file's value

Discussion in 'Unity Build Automation' started by Sandroid82, Jan 26, 2020.

  1. Sandroid82

    Sandroid82

    Joined:
    Nov 15, 2013
    Posts:
    6
    Hello! My project needs to include iCloud capability but the build fails with this error:

    Provisioning profile "MyPrivisioningProfile" doesn't match the entitlements file's value for the com.apple.developer.ubiquity-kvstore-identifier entitlement. (in target 'Unity-iPhone' from project 'Unity-iPhone')

    Here's the PostProcessBuild script:
    Code (CSharp):
    1. #if UNITY_IOS
    2. using UnityEditor.iOS.Xcode;
    3. #endif
    4. using UnityEngine;
    5. using UnityEditor.Callbacks;
    6. using UnityEditor;
    7.  
    8.  
    9. public class IosPostProcessBuild : MonoBehaviour
    10. {
    11.     [PostProcessBuild]
    12.     private static void OnPostprocessBuild(BuildTarget buildTarget, string path)
    13.     {
    14.         if (buildTarget == BuildTarget.iOS)
    15.         {
    16.             string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
    17.             ProjectCapabilityManager projCapability = new ProjectCapabilityManager(projPath, "Unity-iPhone/spingram.entitlements", PBXProject.GetUnityTargetName()); //"Unity-iPhone/spingram.entitlements"  //"Unity-iPhone"
    18.  
    19.             //projCapability.AddGameCenter();
    20.             //string[] empty = null;
    21.             projCapability.AddiCloud(true, false, new string[] {});
    22.             projCapability.WriteToFile();
    23.         }
    24.     }
    25. }
     
  2. sbsmith

    sbsmith

    Joined:
    Feb 7, 2013
    Posts:
    126
    I've seen that error if the App ID Configuration on the developer site doesn't have iCloud checked off. I think it can also happen if the com.apple.developer.ubiquity-kvstore-identifier is pointed at an invalid target. I'm currently working through a similar problem. AddiCloud sets a default value for com.apple.developer.ubiquity-kvstore-identifier and doesn't have a parameter to specify a target.
     
    Last edited: Jan 27, 2020
  3. Sandroid82

    Sandroid82

    Joined:
    Nov 15, 2013
    Posts:
    6
    Everything is right on the developer website. Previously I built with Xcode and iCloud did work.
    Unfortunately I can't use Xcode because of Kernel panic issue while archiving.
     
  4. sbsmith

    sbsmith

    Joined:
    Feb 7, 2013
    Posts:
    126
    Do you have multiple entitlements files and the project is using the wrong one? I've seen that happen too.
     
  5. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    189
    @sandroid
    Hey there! I'm having the same issue today, tried many different ways over the internet, still can't solve this. Building via Xcode works fine but this happens every time via Cloud Build.

    Did you find a solution to this problem?

    Thanks,
    Charles
     
  6. RonDramaton

    RonDramaton

    Joined:
    Feb 24, 2021
    Posts:
    4
    Bump...

    Got the same problem.
    Anyone know of a solution?
     
  7. Danny327

    Danny327

    Unity Technologies

    Joined:
    Jan 4, 2021
    Posts:
    78
    You may be running into the issue described in this forum post about Xcode 10 and the new Xcode build system. It represents an issue with the new build system that matches the behavior in OP's report. It suggests a custom Fastlane configuration is the best workaround for it.
     
  8. RonDramaton

    RonDramaton

    Joined:
    Feb 24, 2021
    Posts:
    4
    Thanks!
    Finally works..!