I’m encountering a build issue in Xcode when trying to build my Unity-based iOS project. I’ve successfully installed CocoaPods, and the workspace project opens correctly. However, when I attempt to build the project and deploy it to a connected iOS device, I receive the following error:
Multiple errors: unknown file type in '/Users/workspace/IOS/IOSBuild2/Libraries/Vendors/UniWebView/libUniWebView.a'; unknown file type in '/Users/workspace/IOS/IOSBuild2/Libraries/Plugins/ImaginationOverflow/UniversalDeepLinking/libs/iOS/libUniversalDeepLink.a'
Linker command failed with exit code 1 (use -v to see invocation)
Details:
Xcode Version: 15.4
Project Type: Unity-based iOS app
Full Error Output:
ld: warning: ignoring duplicate libraries: '-lc++'
ld: multiple errors: unknown file type in '/Users/workspace/IOS/IOSBuild2/Libraries/Vendors/UniWebView/libUniWebView.a'; unknown file type in '/Users/workspace/IOS/IOSBuild2/Libraries/Plugins/ImaginationOverflow/UniversalDeepLinking/libs/iOS/libUniversalDeepLink.a'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What I’ve Tried:
Checked for File Corruption: I re-downloaded the .a files (libUniWebView.a and libUniversalDeepLink.a) to ensure they weren’t corrupted.
Verified File Paths: I confirmed that the file paths in Xcode’s Build Phases under Link Binary With Libraries were correct.
Build Settings: I ensured that LIBRARY_SEARCH_PATHS and FRAMEWORK_SEARCH_PATHS are correctly set to include the directories containing these .a files.
Checked Architecture Compatibility: I used the lipo command to check that the .a files support the target architecture (ARM64). The output confirmed that the architectures are correct.
Re-added Libraries: I removed and re-added the .a files to the Xcode project to force recognition.
Clean Build: I performed a clean build (Product > Clean Build Folder).
Despite these steps, the issue persists, and I’m unable to build the project successfully. The linker continues to fail, citing “unknown file type” for these static libraries.
Questions:
Has anyone encountered a similar issue with Unity-generated iOS projects?
Are there specific settings or configurations in Xcode 15.4 that might be causing this issue?
Could this be related to the way Unity exports the Xcode project, and if so, how can I resolve it?
Any guidance or solutions would be greatly appreciated!
Eranda Kodagoda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.