我已经为此研究了两天,搜索了互联网的各个角落,但找不到任何解决方案。
目前,当我尝试在 M1 Max 上构建 React-Native Xcode 项目时,我得到了很多符号的
ld: symbol(s) not found for architecture x86_64 clang
。在常规 M1 上,构建会完成。
我似乎找不到任何与 clang 错误有远程关系的差异。
还要求几位同事运行该项目,很少有人出现相同的错误(M1 Pro 和 M1 Max),还有一位在各方面都具有几乎相同的设置,并且在他的机器上进行了构建(M1 Pro MBP,相同的 macOS(认为蒙特雷大苏尔可能在某个地方有所不同,但似乎不是),红宝石,节点等)
我还尝试寻找搜索路径和项目设置的任何问题,但它看起来很好(它在其他机器上也构建得很好)。这意味着可能 100% 是设置问题。我还应该提到,我尝试构建的其他项目运行良好。
我应该通过哪些方式来寻找机器之间的差异?
任何评论都会非常有帮助,但现在完全丢失了。谢谢。
Showing Recent Errors Only
Undefined symbol: _pb_ostream_from_buffer
Undefined symbol: _pb_encode_string
Undefined symbol: _pb_decode_varint
Undefined symbol: _pb_encode_submessage
Undefined symbol: _pb_decode
Undefined symbol: _GPBClearOneof
Undefined symbol: _OBJC_CLASS_$_GTMLogMininumLevelFilter
Undefined symbol: _OBJC_CLASS_$_GPBCodedOutputStream
Undefined symbol: _pb_read
Undefined symbol: _OBJC_CLASS_$_GPBInt32Array
Undefined symbol: _OBJC_CLASS_$_GPBDescriptor
Undefined symbol: _OBJC_METACLASS_$_GPBMessage
Undefined symbol: _OBJC_CLASS_$_GPBMessage
Undefined symbol: _pb_istream_from_buffer
Undefined symbol: _OBJC_CLASS_$_GPBRootObject
Undefined symbol: _OBJC_METACLASS_$_GPBRootObject
Undefined symbol: _OBJC_CLASS_$_GDTCORTransport
Undefined symbol: _OBJC_CLASS_$_GTMSessionCookieStorage
Undefined symbol: _OBJC_CLASS_$_GTMSessionFetcher
Undefined symbol: _OBJC_CLASS_$_GTMLogger
Undefined symbol: _OBJC_CLASS_$_GTMSessionFetcherService
Undefined symbol: _OBJC_CLASS_$_GULCCComponentType
Undefined symbol: _OBJC_CLASS_$_GPBEnumArray
Undefined symbol: _OBJC_METACLASS_$_GTMLogger
Undefined symbol: _GULLogInfo
Undefined symbol: _GULIsLoggableLevel
Undefined symbol: _GULLogBasic
Undefined symbol: _kGULNetworkHTTPStatusCodeNotFound
Undefined symbol: _kGULNetworkHTTPStatusOK
Undefined symbol: _kGULNetworkHTTPStatusCodeCannotAcceptTraffic
Undefined symbol: _GULLogWarning
Undefined symbol: _OBJC_CLASS_$_GULNetwork
Undefined symbol: _OBJC_CLASS_$_GPBEnumDescriptor
Undefined symbol: _OBJC_CLASS_$_GULAppDelegateSwizzler
Undefined symbol: _OBJC_CLASS_$_FlipperKitReactPlugin
Undefined symbol: _OBJC_CLASS_$_GULAppEnvironmentUtil
Undefined symbol: _kGULNetworkHTTPStatusCodeNotModified
Undefined symbol: _GULLogError
Undefined symbol: _kGULNetworkHTTPStatusCodeUnavailable
Undefined symbol: _OBJC_CLASS_$_FIRComponent
Undefined symbol: _OBJC_CLASS_$_RCTBridge
Undefined symbol: _OBJC_CLASS_$_GULMutableDictionary
Undefined symbol: _OBJC_CLASS_$_FIRAuth
Undefined symbol: _OBJC_CLASS_$_FIRInstallations
Undefined symbol: _kFIRLoggerAnalytics
Undefined symbol: _FIRFirebaseVersion
Undefined symbol: _OBJC_CLASS_$_RCTBundleURLProvider
Undefined symbol: _OBJC_CLASS_$_GULUserDefaults
Undefined symbol: _OBJC_CLASS_$_FlipperKitNetworkPlugin
Undefined symbol: _pb_encode_varint
Undefined symbol: _OBJC_CLASS_$_GULCCComponent
Undefined symbol: _OBJC_CLASS_$_FKUserDefaultsPlugin
Undefined symbol: _OBJC_CLASS_$_SKDescriptorMapper
Undefined symbol: _kGTMSessionFetcherStatusDomain
Undefined symbol: _OBJC_CLASS_$_GULCCComponentContainer
Undefined symbol: _pb_encode
Undefined symbol: _OBJC_CLASS_$_Orientation
Undefined symbol: _OBJC_CLASS_$_FlipperClient
Undefined symbol: _OBJC_CLASS_$_RNCPushNotificationIOS
Undefined symbol: _GULSetLoggerLevel
Undefined symbol: _OBJC_CLASS_$_FlipperKitLayoutPlugin
Undefined symbol: _OBJC_CLASS_$_GULSwizzler
Undefined symbol: _OBJC_CLASS_$_RNBootSplash
Undefined symbol: _pb_encode_tag_for_field
Undefined symbol: _OBJC_CLASS_$_FIROptions
Undefined symbol: _OBJC_CLASS_$_RNBranch
Undefined symbol: _OBJC_CLASS_$_RCTLinkingManager
Undefined symbol: _OBJC_CLASS_$_UAirship
Undefined symbol: _OBJC_CLASS_$_GPBFileDescriptor
Undefined symbol: _OBJC_CLASS_$_FIRApp
Undefined symbol: _OBJC_CLASS_$_RCTRootView
Undefined symbol: _FIRInstallationIDDidChangeNotification
Undefined symbol: _kGULNetworkHTTPStatusNoContent
Undefined symbol: _OBJC_CLASS_$_SKIOSNetworkAdapter
react-native info
差异(M1 mac mini / M1 Max MBP)
brew list --versions
差异(M1 Max MBP / M1 mac mini)
唯一对我有用的就是将 Podfile 上“post_install”的所有部分替换为下面的代码。
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
之后。在 iOS 文件夹的终端中运行以下命令。
pod deintegrate && pod install
现在清理 Xcode 上的构建缓存并运行项目。
快捷键:CMD + SHIFT + K
如果此解决方案对您不起作用,请尝试这个解决方案,它解决了我的应用程序