'Ello there!
I've just returned to an older project to do some refreshing, mainly migrating as much as possible from old-school fat frameworks to XCFrameworks. Yet doing so, I've encountered an issue with
xcodebuild
(originating in XCBCore
– one of XCBCore.XCFrameworkValidationError
s?):
There is no XCFramework found at <full path to potential *.xcframework>
I have a custom Build Phases > Run Script
taking care of checking for framework existence and its binary checksums to perform a fetch and unpack of precompiled frameworks from a dedicated S3 storage in case some are missing (after clean repo checkout, on CI, etc.) or have changed, right at the top of the Build Phases
tree, just before the Compilation step.
Now – with old-fashioned frameworks, this worked nicely for years, but now it seems some XCFrameworks validator is involved very early in Build setup, preventing me to hit the Build Phase script to fetch xcframework
s. I've tried:
- putting the script to a separate Aggregated target which the main target would depend upon
- hoping it would be strictly run first
- making a stub Library target which the main target would depend upon
- hoping it would be strictly built first
- migrating to a workspace with a stub library kept in a different project
- hoping it would be finally built separately before the main target
- putting the script invocation to all possible Build Pre-actions
- disabling parallel building where possible
- disabling Workspace validation
yet with no luck. The validator instantly realises those files don't exist yet and fail the build.
Running my Frameworks checking script manually fixes it (yet cleanup is needed in case it has failed previously like if Xcode didn't really reflect the files have been added externally) but that still doesn't really help if I want to keep it in the build flow so the whole process is just open-project-and-run.
Assuming the validator runs really really early in the build preparation, I'm struggling to find a way around. Do you guys have any other idea I could try? Cc @NeoNacho as a build systems guru who might have a much deeper insight into how the actual Xcode internals work.