Undefined symbol: _OBJC_CLASS_$_SFSDKLogger && _OBJC_METACLASS_$_SFSDKLogger

1.2k Views Asked by At

I'll list my pods below.

  # 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 version is 12.4

If I run on the device the error report is:-

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

If I run on the simulator the error report is:-

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

Thanks in advance.

2

There are 2 best solutions below

0
Sreekanth G On

It's a strange issue. Now It's working fine but I haven't touched the code from the last month.

I did the same thing that when I posted this question. typing the below commands.

pod deintegrate and pod install

0
Ilies OULD MENOUER On

Cleaning the project did solve the issue for me :

try CMD + Shift + K