- Xcode: 26.4 (17E192)
- Cocos Creator: 3.7.2
After exporting an iOS project, it failed to compile with this error:
1 | ios.xcodeproj 64-bit mach-o member 'utils.o' not 8-byte aligned in '/Applications/Cocos/Creator/3.7.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/external/ios/libs/libwebp.a' |
Nothing in the project had changed, so the failure was confusing at first. I later learned that the libwebp.a bundled with Cocos Creator 3.7.2 conflicts with the linker in newer Xcode versions. That reminded me that I had upgraded Xcode the previous Friday.
Tip: avoid upgrading development tools unnecessarily in the middle of a project. Toolchain updates can introduce subtle compatibility problems.
Solution
I used the second repair approach from this Cocos forum discussion.
Open a terminal, enter the directory containing libwebp.a, and run:
1 | lipo libwebp.a -thin arm64 -output libwebp_fixed.a |
Return to Xcode, clean the build cache, and rebuild the project. After this repair, my libwebp.a file was 321 KB and the project compiled successfully.