23
votes

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_WKWebView", referenced from: ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

enter image description here

Any help is appreciated!

3
Did you link the WebKit framework to your project?Jonathan
Yeah, I'm sure I imported #import <WebKit/WebKit.h>. But the minimum version of Xcode deploy is 7.0.Johnny
I mean, did you: 1. Click on your project in Xcode 2. Select General 3. Locate "Linked Frameworks and Libraries" 4. Click the plus button at the bottom and select "WebKit.framework" 5. Click Add?Jonathan
If you're minimum deployment target is iOS 7 you'll need to check which version of the OS the device is running. If the user is running iOS 7 you'll have to fall back to UIWebView. If they are using iOS 8 you can use WKWebView. This post will help you: stackoverflow.com/questions/25341238/…Jonathan
@Jonathan You saved me . 1.I annotated these WKWebView code, that's running ok.Johnny

3 Answers

30
votes

Just for reference:

Go to your Project -> General -> Linked Frameworks and Libraries then add WebKit.framework

What you see here is that the WebKit framework is used but the actual binary is not getting linked.

1
votes

Check if @implementation is absence. This answer gives you more info.

0
votes

Delete Derived Data -> Clean -> Build