我在我的新Swift 2.0項目中使用了一些外部代碼,它需要在早期版本中使用「libz.dylib」。更新到新的XCode /新SDK之後。Swift 2/iOS 9 - 找不到libz.dylib
Xcode是現在無法導入libz.dylib,並引發了一些錯誤
Undefined symbols for architecture i386: "_deflate", referenced from: +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "_deflateEnd", referenced from: +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "deflateInit2", referenced from: +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "_inflate", referenced from: +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "_inflateEnd", referenced from: +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "inflateInit2", referenced from: +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
當尋找通過「建階段」的設置,我可以找到「libz.tbd」,這似乎是可用的軟件包替換爲libz.dylib。當導入這個庫鏈接錯誤保持不變,但我得到這個額外的警告:
warning: skipping file '/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/lib/libz.tbd' (unexpected file type 'text' in Frameworks & Libraries build phase)
任何想法該怎麼辦?
嘗試產品清除。如果它沒有幫助。刪除Xcode緩存和派生數據 –
我同意@LeoDabus使用「產品清除」。作爲一個新項目,添加這個tbd(它代表什麼?)會很好地編譯。 – Laurent
我已經清理並重建了孔項目 - 同樣的問題! –