未定义符号:_OBJC_CLASS_$_SFSDKLogger && _OBJC_METACLASS_$_SFSDKLogger

Posted

技术标签:

【中文标题】未定义符号:_OBJC_CLASS_$_SFSDKLogger && _OBJC_METACLASS_$_SFSDKLogger【英文标题】:Undefined symbol: _OBJC_CLASS_$_SFSDKLogger && _OBJC_METACLASS_$_SFSDKLogger 【发布时间】:2021-06-10 17:15:06 【问题描述】:

我将在下面列出我的 pods

  # Pods for SalesForceSDK
  pod 'SalesforceAnalytics', :path => 'mobilesdkpath/SalesforceMobileSDK-ios'
  pod 'SalesforceSDKCore', :path => 'mobilesdkpath/SalesforceMobileSDK-iOS'
  pod 'SmartStore', :path => 'mobilesdkpath/SalesforceMobileSDK-iOS'
  pod 'SmartSync', :path => 'mobilesdkpath/SalesforceMobileSDK-iOS'
  pod 'SalesforceSwiftSDK', :path => 'mobilesdkpath/SalesforceMobileSDK-iOS'
  pod 'PromiseKit', :git => 'https://github.com/mxcl/PromiseKit', :tag => '5.0.3'

XCode 版本为 12.4

如果我在设备上运行,错误报告是:-

Undefined symbols for architecture arm64:                   
    "OBJC_CLASS$_SFSDKLogger", referenced from: 
         OBJC_CLASS$_SFSDKSmartStoreLogger in SFSDKSmartStoreLogger.o 
    "OBJC_METACLASS$_SFSDKLogger", referenced from: 
         OBJC_METACLASS$_SFSDKSmartStoreLogger in SFSDKSmartStoreLogger.o          
ld: symbol(s) not found for architecture arm64                                  
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Undefined symbol: _OBJC_CLASS_$_SFSDKLogger
Undefined symbol: _OBJC_METACLASS_$_SFSDKLogger

如果我在模拟器上运行,错误报告是:-

Undefined symbols for architecture x86_64:                   
    "OBJC_CLASS$_SFSDKLogger", referenced from: 
         OBJC_CLASS$_SFSDKSmartStoreLogger in SFSDKSmartStoreLogger.o 
    "OBJC_METACLASS$_SFSDKLogger", referenced from: 
         OBJC_METACLASS$_SFSDKSmartStoreLogger in SFSDKSmartStoreLogger.o          
ld: symbol(s) not found for architecture arm64                                  
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Undefined symbol: _OBJC_CLASS_$_SFSDKLogger
Undefined symbol: _OBJC_METACLASS_$_SFSDKLogger

提前致谢。

【问题讨论】:

【参考方案1】:

这是一个奇怪的问题。现在它工作正常,但我没有触及上个月的代码。

当我发布这个问题时,我做了同样的事情。输入以下命令。

pod deintegrate 和 pod install

【讨论】:

以上是关于未定义符号:_OBJC_CLASS_$_SFSDKLogger && _OBJC_METACLASS_$_SFSDKLogger的主要内容,如果未能解决你的问题,请参考以下文章

架构 x86_64 的未定义符号:“_OBJC_CLASS_$_RCTImageLoader”

架构 i386 的未定义符号:“_OBJC_CLASS_$_MFMailComposeViewController”

架构 i386 的未定义符号:“_OBJC_CLASS_$_SecIdentity”

未定义符号 RealmSwift:“_OBJC_CLASS_$_RLMNotificationToken”,clang 错误

架构 armv7 的未定义符号:“_OBJC_CLASS_$_SSZipArchive”

架构 i386 的未定义符号:“_OBJC_CLASS_$_TLFApplicationHelper”