如何解决架构arm64的未定义符号,似乎只是某些使用cocoapods的第三方框架随机发生了
发生了什么
- 我使用
Cocoapods
管理一些第三方框架 - 我使用了一些专用规范存储库
- 不止一个私人存储库依赖于相同的第三方容器
- 修改依赖项结构后,我构建了工作空间,它显示了以下错误:
Undefined symbols for architecture arm64:
"_OBJC_METACLASS_$_UIView",referenced from:
_OBJC_METACLASS_$_iCarousel in iCarousel.o
"_OBJC_CLASS_$_UIButton",referenced from:
objc-class-ref in iCarousel.o
"_OBJC_CLASS_$_UIScrollView",referenced from:
objc-class-ref in iCarousel.o
"_OBJC_CLASS_$_UIScreen",referenced from:
objc-class-ref in iCarousel.o
"_OBJC_CLASS_$_UITapGestureRecognizer",referenced from:
objc-class-ref in iCarousel.o
"_OBJC_CLASS_$_UIView",referenced from:
objc-class-ref in iCarousel.o
_OBJC_CLASS_$_iCarousel in iCarousel.o
"_OBJC_CLASS_$_UIBarButtonItem",referenced from:
objc-class-ref in iCarousel.o
"_UITrackingRunLoopMode",referenced from:
-[iCarousel startAnimation] in iCarousel.o
"_CGSizeZero",referenced from:
-[iCarousel setUp] in iCarousel.o
"_OBJC_CLASS_$_UIPanGestureRecognizer",referenced from:
objc-class-ref in iCarousel.o
"_UIAccessibilityTraitAllowsDirectInteraction",referenced from:
-[iCarousel setUp] in iCarousel.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我为解决这个问题做了什么?(没有一个起作用)
-
rm -rf ~/Library/Developer/Xcode/DerivedData/
删除了Xcode缓存 - 按
$ rm -rf "${HOME}/Library/Caches/CocoaPods" $rm -rf "
pwd/Pods/" $pod update
删除的Cocoapods缓存 - 将Xcode版本更新为12.0.1
哦,不,同样的错误!
接下来我要做什么...
我决定继续努力,于是将这些内容添加到我的Podfile
中:
if target.name == "iCarousel"
config.build_settings['OTHER_LDFLAGS'] ||= ['$(inherited)']
config.build_settings['OTHER_LDFLAGS'] << '-framework "UIKit"'
config.build_settings['OTHER_LDFLAGS'] << '-framework "CoreGraphics"'
end
然后,pod install
建立我的项目...
好消息!与iCarousel无关!坏消息是,另一个pod发生了相同的旧错误:PomeloPush
Undefined symbols for architecture arm64:
"_SCNetworkReachabilitySetDispatchQueue",referenced from:
-[PomeloReachability startNotifier] in PomeloReachability.o
-[PomeloReachability stopNotifier] in PomeloReachability.o
"_SCError",referenced from:
-[PomeloReachability startNotifier] in PomeloReachability.o
"_SCErrorString",referenced from:
-[PomeloReachability startNotifier] in PomeloReachability.o
"_SCNetworkReachabilityGetFlags",referenced from:
-[PomeloReachability isReachable] in PomeloReachability.o
-[PomeloReachability isReachableViaWWAN] in PomeloReachability.o
-[PomeloReachability isReachableViaWiFi] in PomeloReachability.o
-[PomeloReachability connectionRequired] in PomeloReachability.o
-[PomeloReachability isConnectionOnDemand] in PomeloReachability.o
-[PomeloReachability isInterventionRequired] in PomeloReachability.o
-[PomeloReachability reachabilityFlags] in PomeloReachability.o
...
"_SCNetworkReachabilitySetCallback",referenced from:
-[PomeloReachability startNotifier] in PomeloReachability.o
-[PomeloReachability stopNotifier] in PomeloReachability.o
"_SCNetworkReachabilityCreateWithAddress",referenced from:
+[PomeloReachability reachabilityWithAddress:] in PomeloReachability.o
"_CFHostStartInfoResolution",referenced from:
+[PomeloHostRequest nslookup:] in PomeloHostRequest.o
"_OBJC_CLASS_$_UIDevice",referenced from:
objc-class-ref in PomeloClient.o
"_SCNetworkReachabilityCreateWithName",referenced from:
+[PomeloReachability reachabilityWithHostname:] in PomeloReachability.o
"_CFHostCreateWithName",referenced from:
+[PomeloHostRequest nslookup:] in PomeloHostRequest.o
"_CFHostGetAddressing",referenced from:
+[PomeloHostRequest nslookup:] in PomeloHostRequest.o
"_OBJC_CLASS_$_UIPasteboard",referenced from:
objc-class-ref in Pomelo_OpenUDID.o
"_UIApplicationDidEnterBackgroundNotification",referenced from:
-[PomeloClient addNotification] in PomeloClient.o
"_UIApplicationWillEnterForegroundNotification",referenced from:
-[PomeloClient addNotification] in PomeloClient.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
然后我在Podfile中添加了一些类似的代码
然后pod install
,构建
哦,另一个Pod发生了类似的错误:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_UIViewController",referenced from:
__OBJC_$_CATEGORY_UIViewController_$_KeyboardAnimation in UIViewController+KeyboardAnimation.o
"_UIKeyboardAnimationDurationUserInfoKey",referenced from:
-[UIViewController(KeyboardAnimation) getDurationFromNotification:] in UIViewController+KeyboardAnimation.o
"_UIKeyboardAnimationCurveUserInfoKey",referenced from:
-[UIViewController(KeyboardAnimation) getAnimationCurveFromNotification:] in UIViewController+KeyboardAnimation.o
"_UIKeyboardFrameEndUserInfoKey",referenced from:
-[UIViewController(KeyboardAnimation) getKeyboardRectFromNotification:] in UIViewController+KeyboardAnimation.o
"_UIKeyboardWillChangeFrameNotification",referenced from:
-[UIViewController(KeyboardAnimation) an_subscribeKeyboardFrameChangesWithAnimations:] in UIViewController+KeyboardAnimation.o
-[UIViewController(KeyboardAnimation) an_unsubscribeKeyboardFrameChanges] in UIViewController+KeyboardAnimation.o
"_UIKeyboardWillShowNotification",referenced from:
-[UIViewController(KeyboardAnimation) an_subscribeKeyboardWithBeforeAnimations:animations:completion:] in UIViewController+KeyboardAnimation.o
-[UIViewController(KeyboardAnimation) an_unsubscribeKeyboard] in UIViewController+KeyboardAnimation.o
"_OBJC_CLASS_$_UIView",referenced from:
objc-class-ref in UIViewController+KeyboardAnimation.o
"_UIKeyboardWillHideNotification",referenced from:
-[UIViewController(KeyboardAnimation) an_subscribeKeyboardWithBeforeAnimations:animations:completion:] in UIViewController+KeyboardAnimation.o
-[UIViewController(KeyboardAnimation) an_unsubscribeKeyboard] in UIViewController+KeyboardAnimation.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
目前,它发生在pop
,AFNetworking
,SDWebImage
,iCarousel
,MJRefresh
等上……
任何建议都可以帮助将不胜感激!!我已经坚持了一个星期...
解决方法
通过观察您的观察结果,您可以尝试以下建议:
- 检查您的cocoapods是否已更新为最新版本。
- 使用Pod Deintegrate移除所有Pod。
- 检查pod的依赖项,然后尝试一一安装。吊舱安装。
- 还要检查库对快速版本的支持。
- 如果两个库都具有相同的代码或扩展名,则会出现错误。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。