Swift 2/iOS 9 – libz.dylib找不到

前端之家收集整理的这篇文章主要介绍了Swift 2/iOS 9 – libz.dylib找不到前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在我的新的Swift 2.0项目中使用一些来自google的外部代码,在早期版本中需要“libz.dylib”。更新到新的XCode /新的SDK后。

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)

任何想法该怎么办?

我有同样的问题。我发现了一些方法

>转到构建阶段>链接二进制与Librairies> >添加其他>在文件选择窗口中执行“CMD”Shift G(转到文件夹)并键入/ usr / lib />从/ usr / lib你可以添加:libz.dylib和更多…>编译和乐趣

猜你在找的Swift相关文章