The HovelHouse CloudKit plugin is provided as a unity-package-manager (UPM) package. At the time of this writing, the asset store does not provide support for UPM packages. As a result, by default, Unity will install the package to the Assets folder. The package needs to be moved into the packages folder in order for post-process build script to correctly locate the code-signing shell script. To fix, simply drag the Cloud Kit Plugin folder out of the assets directory and into the Packages folder.
The included resign.sh script is missing the appropriate permissions to run as an executable. Attempting a MacOS build will result in the following error until the script is given executable permissions:
Win32Exception: ApplicationName='/YourProjectPath/Packages/CloudKit/ShellScripts/resign.sh', CommandLine='-a "/YourProjectPath/YourApp.app" -i "Mac Developer: FirstName LastName (TEAM_ID)" -e "/BuildPath/YourApp.app/../yourapp.entitlements" -v "/ProvisioningProfilePath/YourProvisioningProfile.provisionprofile"', CurrentDirectory='', Native error= Access denied System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at
:0) System.Diagnostics.Process.Start () (at :0) (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start() HovelHouse.CloudKit.BuildProcess.PostProcessMacOS (System.String path) (at Packages/CloudKit/Editor/BuildProcess.cs:179) Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown. HovelHouse.CloudKit.BuildProcess.PostProcessMacOS (System.String path) (at Packages/CloudKit/Editor/BuildProcess.cs:204) HovelHouse.CloudKit.BuildProcess.OnPostprocessBuild (UnityEditor.BuildTarget target, System.String path) (at Packages/CloudKit/Editor/BuildProcess.cs:61)...
To fix, open the terminal and add the excutable permission to the script by typing "
chmod +x /YourProjectPath/Packages/CloudKit/ShellScripts/resign.sh". A quick way to copy the path the file is to locate it in the finder and drag it into the terminal. The path will be pasted at the current cursor location.
The MacOS build script ignores the "Add Default Containers" checkbox. This results in the creation of an entitlments file with no entries for the cloud containers. Signing the app with this entitlements file will create an app that crashes with a code-signing error on startup. To fix, uncheck the add default containers checkbox, and manually enter the default container in the custom containers list. The add default containers checkbox is correctly read by the iOS build script, so if the box is not un-checked, the iOS project will generate a duplicate entry in the entitlements file.
You may want to verify that the entitlements file the MacOS build produces is correct by opening the generated file in the build folder.
The plugin does not include an iOS library that contains the armv7 architecture. Attempting to build a Unity project in "Universal Binary" mode will result in a project expecting armv7 architectures and will cause inker errors when built in XCode. Unity will deprecate armv7 support in Unity 2020 and most iOS devices are now running arm64 chips. Evenso, this has confused a good number of users as Universal Binary is the default build configuration for earlier versions of the Unity editor. Support for a fat-binary or separate libraries for arm64 and armv7 is on the roadmap for the next update.