Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error

Solution 1:

You can get this type of error if your class' .m file is not listed under the "Compile Sources" step of the "Build Phases" tab of your target. Normally Xcode does this for you, but sometimes it loses the plot and you need to add the .m file manually.

To do this:

TargetSettings -> Build Phases -> Compile Sources -> add your .m class ->Build and Run

Solution 2:

for me the issue turned out to be missing frameworks. Once I added em, it worked.

Solution 3:

Check the Valid Architectures & Build Active Architecture only properties.

enter image description here

Solution 4:

if you are using cocoapods make sure your target's build settings contain $(inherited) in the other linker flags section

enter image description here