Whenever I try to build an iOS app through Cloud Build I alway get the same error, listed below. does anyone know how to fix this??
error: Provisioning profile “Tempest Studios - Flappy bat” 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’)
This shouldn’t be that hard, but it seems not that many people have the same issue.
Where you able to fix that?
Hi @That_Mason_Guy . If you are only getting this problem when building on Cloud Build, and you are able to archive and export a binary locally, please only a support ticket so the support team can investigate the cause of the problem.
Putting this here incase anyone else has the same issue…
The problem for me was fastlane
which is used by Unity Cloud Build has trouble unpacking the $(TeamIdentifierPrefix)
from your entitlements file.
I just replaced this line in my app.entitlements <string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
with my actual team identifier and bundle identifier. so like: <string>ABC01234DE.com.company.appname</string>
That seemed to work fine.
Unity Cloud Build Xcode 10 release and build infrastructure changes this thread discusses the issue, but involves a much more complicated solution than the one I mentioned above.
1 Like
hey @VoxelMatt , sorry for the silly question, where is located app.entitlements?
If you don’t have a .entitlements file in your Unity project - XCode will create one for you.
We create our [appname].entitlements file in a postbuild step…
So, in order to add a capability what should I use? GetEntitlementFilePathForTarget or ProjectCapabilityManager?
Cause I made a test with this code but it doesn’t work (it doesn’t add the com.apple.developer.ubiquity-kvstore-identifier entitlement)
[PostProcessBuild(9999)]
public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
{
if (buildTarget != BuildTarget.iOS && buildTarget != BuildTarget.tvOS) return;
AddICloud(path);
}
private static void AddICloud(string path)
{
string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
var project = new PBXProject();
ProjectCapabilityManager projCapability = new ProjectCapabilityManager(projPath, "Unity-iPhone/RealOffroadRacing.entitlements", project.GetUnityMainTargetGuid());
projCapability.AddiCloud(true, false, new string[] {});
projCapability.WriteToFile();
}