XZ

xiaoxiao2021-02-28  159

当使用WKWebView的时候,出现下列错误: 1、Undefined symbols for architecture i386:   "_OBJC_CLASS_$_WKWebView", referenced from:       objc-class-ref in XZPartImageController.o       objc-class-ref in XZSharePartImageController.o   "_OBJC_CLASS_$_WKWebViewConfiguration", referenced from:       objc-class-ref in XZPartImageController.o   "_OBJC_CLASS_$_WKUserContentController", referenced from:       objc-class-ref in XZPartImageController.o   "_OBJC_CLASS_$_WKUserScript", referenced from:       objc-class-ref in XZPartImageController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 在Info中的General最下方的Linked Frameworks and Libraries中添加WebKit.framework框架 2、 项目嵌入环信UI,导致出现下方6个错误 Undefined symbols for architecture x86_64:   "_ACAccountTypeIdentifierTwitter", referenced from:       -[PF_Twitter getLocalTwitterAccountAsync] in Parse(PF_Twitter.o)   "_OBJC_CLASS_$_ACAccountStore", referenced from:       objc-class-ref in Parse(PF_Twitter.o)   "_OBJC_CLASS_$_SLComposeViewController", referenced from:       objc-class-ref in Parse(PF_Twitter.o)   "_OBJC_CLASS_$_SLRequest", referenced from:       objc-class-ref in Parse(PF_Twitter.o)   "_SLServiceTypeTwitter", referenced from:       -[PF_Twitter getAccessTokenForReverseAuthAsync:localTwitterAccount:] in Parse(PF_Twitter.o)       -[PF_Twitter getLocalTwitterAccountAsync] in Parse(PF_Twitter.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 解决方法:在TARGETS—Build Phases—Link Binary With Libraries 中添加以下两个库即可解决 Social.framework Accounts.framework 像以上几个问题都是缺少框架导致的,有的时候我们不知道缺少什么框架,那就看每一对””括起来的部分,这部分的前缀都是框架的缩写,如果缩写也看不出来是哪个框架的话,只能通过缩写的第一个首字母查看了,然后根据显示出来的库的名称去匹配 3、 ld:2 duplicate symbols for architecture x86_64  clang:error:linker command failed with exit code 1(use -v to see invocation) 定义了两个名为XZSecondKillViewController.h和XZSecondKillViewController.m的控制器 定义了两个名为XZSecondKillViewController.h和XZSecondKillViewController.m的控制器,将其中一个重新命名即可 4、20 duplicate symbols for architecture x86_64 从图片可以看出大概产生错误的3个地方,ZX开头的框架有些文件重复了导致的,XZQRView引用了这个框架和ThemeManager的重复,但是我在程序中并未搜到重复的文件,我删除了DriveData中的数据,重新运行还是不可以,然后我把重复的文件删除之后再重新导入就可以了。我把Xcode说的重复的ZX开头的第三方框架删除,Command + B编译一下,然后再把这个第三方框架重新导入,发现就少了一部分错误,其他的2个错误也是同样的方法,最终错误消除。 5、Xcode   Build时有错误,点击错误Xcode没反应,上方显示一个错误,点击错误,不显示详细的错误信息,如果我们想要查看详细的错误信息,可以按下面的方法查看 6、左滑手势返回的时候,或者是push到下一个页面的时候,右上角出现黑色的问题,因为没有设置 navigation的背景色 7、使用cocoaPod导入的极光框架,但是运行在iPhone 5的模拟器上报如下错误 Undefined symbols for architecture i386:   "_OBJC_CLASS_$_JPUSHService", referenced from:       objc-class-ref in AppDelegate.o   "_OBJC_CLASS_$_JPUSHRegisterEntity", referenced from:       objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 解决: 注意:不支持 Xcode 8.0 以下版本 开启 bitcode。注意 3.0.0及以上版本将不再支持处理器为i386的模拟器。添加libresolv.tbd库,否则编译运行会报错(2.2.0及以上版本要求) 8、将collectionView的创建写在viewDidLoad中,该控制器在显示的时候隐藏了导航栏,页面disappear的时候显示导航栏出现collectionView整体上移的情况,底部20px的留白的情况,将collectionView进行懒加载,不在viewDidLoad中创建,这种情况就没有了!!! 9、 2017-10-16 13:43:48.629340+0800 XZScrollView[15353:1249891] Logging only once for UICollectionViewFlowLayout cache mismatched frame 2017-10-16 13:43:48.629493+0800 XZScrollView[15353:1249891] UICollectionViewFlowLayout has cached frame mismatch for index path <NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0} - cached value: {{24.21875, 114.48985677083334}, {271.5625, 588.02333333333331}}; expected value: {{35, 167.33333333333334}, {250, 541.33333333333337}} 2017-10-16 13:43:48.629572+0800 XZScrollView[15353:1249891] This is likely occurring because the flow layout subclass XZFlowLayout is modifying attributes returned by UICollectionViewFlowLayout without copying them 解决:将下面代码 NSArray *array = [ super layoutAttributesForElementsInRect :rect]; 替换成 NSArray *array = [[ NSArray alloc ] initWithArray :[ super layoutAttributesForElementsInRect :rect] copyItems : YES ]; 即可。 10、 解决DVTPlugInManager: Required plug-in compatibility UUID DF11C142-1584-4A99-87AC-1925D5F5652A for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present 问题: 2017-10-23 08:26:06.457 xcodebuild[1734:94610] [MT] DVTPlugInManager: Required plug-in compatibility UUID DF11C142-1584-4A99-87AC-1925D5F5652A for KSImageNamed.ideplugin (com.ksuther.KSImageNamed) not present 2017-10-23 08:26:07.552 xcodebuild[1734:94610] [MT] PluginLoading: Required plug-in compatibility UUID DF11C142-1584-4A99-87AC-1925D5F5652A for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/VVDocumenter-Xcode.xcplugin' not present in DVTPlugInCompatibilityUUIDs 2017-10-23 08:26:07.571 xcodebuild[1734:94610] [MT] PluginLoading: Required plug-in compatibility UUID DF11C142-1584-4A99-87AC-1925D5F5652A for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs 解决: 通过路径' ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin '找到 Alcatraz.xcplugin插件,然后 右键/显示包内容/Contents/Info.plist 打开找到 DVTPlugInCompatibilityUUIDs,将UUID后面的那一串 DF11C142-1584-4A99-87AC-1925D5F5652A粘贴进去即可,其他的插件也是相同的原理,将最新版的Xcode的UUID放在DVTPlugInCompatibilityUUIDs数组里面。
转载请注明原文地址: https://www.6miu.com/read-23541.html

最新回复(0)