Swift "ld: symbol(s) not found for architecture arm64" in CI
The compile step succeeded but the linker could not find one or more symbols for arm64. A dependency library was not built or linked, an object targets a different architecture, or a system framework is not linked.
What this error means
The build ends at link time with "ld: symbol(s) not found for architecture arm64" and "clang: error: linker command failed with exit code 1".
Undefined symbols for architecture arm64:
"_$s10Networking6ClientCACycfC", referenced from:
_$s3App0A0V6clientAA10Networking6ClientCvpfi in App.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)Common causes
A dependency was not built or linked
The module compiled against a dependency whose object code was not built or linked for arm64, leaving its symbols undefined.
An architecture or SDK mismatch
Objects built for a different architecture (or against a different SDK) mix with the arm64 build, so symbols do not line up at link time.
How to fix it
Clean and rebuild the full dependency graph
- Remove
.buildso no stale objects are reused. - Rebuild for a single architecture so all objects match.
- Confirm every linked dependency built successfully first.
rm -rf .build
swift buildLink the missing framework or library
If the undefined symbol belongs to a system framework, declare it as a linked framework on the target.
.target(
name: "App",
linkerSettings: [.linkedFramework("Security")]
)How to prevent it
- Key build caches on architecture so arm64 and x86_64 objects never mix.
- Declare required system frameworks in
linkerSettings. - Rebuild dependencies cleanly when switching runner architectures.