iOS Bundle ID has not been set up, Unity Cloud Build
I am getting the following error with unity cloud build.
However, the my bundle id IS correctly setup everywhere (see image).
I have already published my app, so the id cannot be changed. I am wondering how to fix this issue, and whether it could be related to this issue.
I have tried using Unity Cloud Build Versions 2019.3 and 2020.x. I have deleted the library and project settings, and that still didnt work. There are no unusual characters (such as spaces or newlines) in the id. Any help is appreciated!
Answer by timebenter · Feb 04, 2021 at 09:37 AM
So I found out the answer for anyone who is interested. Unity Cloud Build currently won't let you upload a build that has a bundle id without a period (.), so you have to add a period to your bundle id, let it build and then change it using the PostProcessBuild Attribute.
1: Create a folder in your project called "Editor"
2: Paste this script in, it will change the BundleID to "SpaceDrift" in the XCode project that is generated between the Unity Build stage and the XCode build stage in Unity Cloud Build
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
using UnityEditor.iOS.Xcode;
using System.IO;
class MyCustomBuildProcessor : MonoBehaviour
{
[PostProcessBuild]
public static void ChangeiOSBundleId(BuildTarget buildTarget, string pathToBuiltProject)
{
if (buildTarget == BuildTarget.iOS)
{
string plistPath = pathToBuiltProject + "/Info.plist";
PlistDocument plist = new PlistDocument();
plist.ReadFromString(File.ReadAllText(plistPath));
// Get root
PlistElementDict rootDict = plist.root;
// Change value in Xcode plist
var buildKey = "CFBundleIdentifier";
rootDict.SetString(buildKey, "SpaceDrift");
// Write to file
File.WriteAllText(plistPath, plist.WriteToString());
}
}
}
Your answer
Follow this Question
Related Questions
Cloud build ios : This device was signed for the App Store and connot be installed 1 Answer
Getcomponent fails when built from cloud build 1 Answer
Can't install profile for the Device Detection to install a Cloud Build shared IPA 0 Answers
Unity Cloud Build IOS Failed 0 Answers
IOS Unity Cloud build failed : Invalid bitcode version 1 Answer