clang: error: linker command failed with exit code 1 while creating ios build

I'm encountering a linker error while trying to build an iOS application developed using Ionic, Capacitor, and Angular. The build process fails for both debug (testing on the device) and release builds.

Ld /Users/Library/Developer/Xcode/DerivedData/App/Build/Products/Debug-iphoneos/WxWxnetwork/WxWxnetwork.framework/WxWxnetwork normal (in target 'WxWxnetwork' from project 'Pods') 
cd /AppName/ios/App/Pods/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios13.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -
L/Users/Library/Developer/Xcode/DerivedData/App/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphoneos -
L/Users/Library/Developer/Xcode/DerivedData/App/Build/Products/Debug-iphoneos/WxWxnetwork -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/lib/swift -
F/Users/Library/Developer/Xcode/DerivedData/App/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphoneos -
F/Users/Library/Developer/Xcode/DerivedData/App/Build/Products/Debug-iphoneos/WxWxnetwork -
F/Users/Library/Developer/Xcode/DerivedData/App/Build/Products/Debug-iphoneos/Capacitor -
F/Users/Library/Developer/Xcode/DerivedData/App/Build/Products/Debug-iphoneos/CapacitorCordova -
F/Users/Documents/Test/ios/App/Pods/../../../node_modules/wx-wxnetwork -filelist 
/Users/Library/Developer/Xcode/DerivedData/App/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/WxWxnetwork.build/Objects-normal/arm64/WxWxnetwork.LinkFileList -install_name @rpath/WxWxnetwork.framework/WxWxnetwork -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker 
/Users/Library/Developer/Xcode/DerivedData/App/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/WxWxnetwork.build/Objects-normal/arm64/WxWxnetwork_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -
L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker 
/Users/Library/Developer/Xcode/DerivedData/App/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/WxWxnetwork.build/Objects-normal/arm64/WxWxnetwork.swiftmodule -framework Capacitor -framework ICDeviceManager -framework Foundation -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker 
/Users/Library/Developer/Xcode/DerivedData/App/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/WxWxnetwork.build/Objects-normal/arm64/WxWxnetwork_dependency_info.dat -o 
/Users/Library/Developer/Xcode/DerivedData/App/Build/Products/Debug-iphoneos/WxWxnetwork/WxWxnetwork.framework/WxWxnetwork

Project Info:

Xcode: 14.3.1
IOS SDK: 16.4
Capacitor: 5.2.2
Ionic: 7 
Angular: 16

I've tried multiple solutions to address the linker error including targeting ios 11. However, none of them have worked so far. Since I can't decrease the target iOS version due to the Capacitor requirement. Any insights or suggestions would be greatly appreciated. Thank you in advance!

I have conducted further investigation into the matter and would like to share additional information pertaining to the question I initially posted. Upon reviewing the logs, I have identified the specific error, which is as follows:

Undefined symbols for architecture arm64:

"_crc32", referenced from:

  _unzReadCurrentFile in ICDeviceManager(unzip.o)

"_deflate", referenced from:

  IComon::logger::LogBuffer::Write(void const*, unsigned long) in ICDeviceManager(log_buffer.o)

"_deflateEnd", referenced from:

  IComon::logger::LogBuffer::~LogBuffer() in ICDeviceManager(log_buffer.o)

IComon::logger::LogBuffer::Flush(IComon::logger::AutoBuffer&) in ICDeviceManager(log_buffer.o)

"deflateInit2", referenced from:

  IComon::logger::LogBuffer::__Reset() in ICDeviceManager(log_buffer.o)

"_get_crc_table", referenced from:

  _unzOpenCurrentFile3 in ICDeviceManager(unzip.o)

"_inflate", referenced from:

  _unzReadCurrentFile in ICDeviceManager(unzip.o)

"_inflateEnd", referenced from:

  _unzCloseCurrentFile in ICDeviceManager(unzip.o)

"inflateInit2", referenced from:

  _unzOpenCurrentFile3 in ICDeviceManager(unzip.o)

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thank you for your attention to this matter. Your assistance is greatly appreciated.

Those are symbols from the libz library. It seems like one of your dependencies depends on that library but it’s not being added to your link command somehow.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

clang: error: linker command failed with exit code 1 while creating ios build
 
 
Q