One of near-identical iOS target fails during signing.

I have one project within Unity Cloud.
This project got DevOps configured, with 2 iOS build targets set up.
These build targets are identical, same repo, same branch, with the only difference being some #Define symbols, a different Bundle ID and a different credential set.
Lets call these Bundle ID com.company.app-a and com.company.app-b, app-a and app-b for short.

The project exists for quite some time, and we wanted to make a variant for Apple’s Business Manager rollout. So I created a provisioning profile for app-b, build it through Unity Cloud, and rolled it out.
Now we developed the app further, and wanted to roll out updates for both variants.
The provisioning profile for app-a expired, so I made a new one and uploaded this to Unity Cloud and attempted to build it.

However, app-a failed building. After some testing, I narrowed it down to an error that happens during signing.
I see the following in the full log in Unity Build Cloud:

[2024-05-31T13:18:20.652Z] - 7.4.5.2.7.4 - INFO: ▸ CodeSign /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-gmzfqhcinhahsufpjdniccrsddzm/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework (in target 'UnityFramework' from project 'Unity-iPhone')```
I tried narrowing down what is causing this, and I found that only building with BundleID app-a and it's signing credentials seems to trigger this.
I cloned the configuration of app-b, removed the #Define symbols and anything that sets it apart from app-a, and it builds successfully.
I created a new certificate in my Apple Developer account, and a new provisioning profile for app-a, but this still causes the above error.
Meanwhile, building with the signing credentials for app-b still works, I'm positive the only difference is the BundleID and the credentials.

I'm completely stumped as to why this error is occurring. Any tips on how to debug this are appreciated.

I’d recommend taking a look at the full XCode log for the failing build. You can download it from the failed build attempt itself or by clicking the ellipses next to the attempt in build history page. That log contains way more details.

Sound advice… But I can only download the full XCode log from successful attempts. Failed attempts do not offer the option to download the full log, only to view the full UCB log.
9869751--1422603--upload_2024-6-3_9-42-49.png

Also, I forgot to mention, these are the last errors at the end of the log:
9869751--1422606--upload_2024-6-3_9-45-7.png
The error that the specific keychain item can’t be found tells me something went wrong with getting the signing credentials into the VM?

I’m also not sure if Scripting #Define Symbols works correctly when building in latest Unity Cloud & Unity 2022.3.31f1, it didn’t seem to alter the behaviour properly on build.

They do seem to work for me. I have several other projects configured with different #Define symbols to compile different code for different platforms and those work fine.

2 Likes

Ok, thanks for info, it might also be TestFlight having some weird issues for me today.

Btw if it’s CodeSign step maybe the actual issue is Fastlane file configuration - did you also change to new Bundle ID there @teunververs ?

I don’t have a Fastlane configuration file in the project itself, I believe Unity generates this when it creates the XCode project?
When you build for iOS in Unity Cloud Build it creates a XCode project, and then uses XCode to compile the iOS app.
I assume Unity Cloud Build uses the Bundle ID I entered in the build config to generate a Fastlane file with the correct Bundle ID here.

You specify Fastlane file path in Unity Cloud Build > Build Automation > Configurations > iOS > Advanced settings > Platform specific settings (iOS)
OR you can also manually upload .ipa file to TestFlight with Transporter app for example,

if you don’t have fastlane configured then you upload .ipa manually, right?

I found the setting, but we aren’t using it.

And yes, you can upload stuff you build locally using Unity to the build cloud, but we don’t use it that way either.

I contacted Unity Support, and they suggested changing the build configuration so it uses XCode 15.2 instead of 15.0.
Which fixed the build for me.

Still leaves me dumbfounded as of why this fixed it, since the other iOS build config that was succeeding was using XCode 15.0 without any issue…

Oh well, it works now at least…

1 Like