title: Xcode: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_AVPlayer"
body: <p>I'm trying to use <code>AVPlayer</code> in my app, i made a test application and it works perfectly, but then when i tried to implement the same <code>AVPlayer</code> in my real app it crashes with these two errors :</p>
  <p><img src="https://i.stack.imgur.com/jcwN9.png" alt="Xcode ScreenShot" /></p>
  <p>This is LiveViewController.h:</p>
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;
  
  @interface LiveViewController : UIViewController&lt;AVAudioPlayerDelegate&gt;
  @property (strong, nonatomic) AVPlayer *audioPlayer;
  @property (strong, nonatomic) IBOutlet UIButton *playPauseBtn;
  - (IBAction)playAudio:(id)sender;
  @end
  </code></pre>
  <p>And this is LiveViewController.m:</p>
  <pre><code>#import &quot;LiveViewController.h&quot;
  
  @interface LiveViewController ()
  
  @end
  
  @implementation LiveViewController
  NSURL *urlStream;
  
  - (void)viewDidLoad {
      [super viewDidLoad];
      
      NSString *urlAddress = @&quot;http://198.178.123.23:8662/stream/1/;listen.mp3&quot;;
      urlStream = [NSURL URLWithString:urlAddress];
      self.audioPlayer = [AVPlayer playerWithURL:urlStream];
      
      NSError *error;
      
      if (error)
      {
          NSLog(@&quot;Error in audioPlayer: %@&quot;,
                [error localizedDescription]);
      } else {
          [_audioPlayer prepareForInterfaceBuilder];
      }
  }
  
  - (void)didReceiveMemoryWarning {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  - (IBAction)playAudio:(id)sender {
      if(self.audioPlayer.rate &gt; 0 &amp;&amp; self.audioPlayer.error == nil){
          [self.audioPlayer pause];
          NSLog(@&quot;Hello there, trying to stop playing!&quot;);
          [self.playPauseBtn setImage:[UIImage imageNamed:@&quot;play_button&quot;]  forState:UIControlStateNormal];
      }else{
          self.audioPlayer = [AVPlayer playerWithURL:urlStream];
          [self.audioPlayer play];
          NSLog(@&quot;Hello there, trying to play!&quot;);
          [self.playPauseBtn setImage:[UIImage imageNamed:@&quot;pause_button&quot;] forState:UIControlStateNormal];
      }
  }
  
  -(void)audioPlayerDidFinishPlaying:
  (AVAudioPlayer *)player successfully:(BOOL)flag
  {
  }
  
  -(void)audioPlayerDecodeErrorDidOccur:
  (AVAudioPlayer *)player error:(NSError *)error
  {
  }
  
  -(void)audioPlayerBeginInterruption:(AVAudioPlayer *)player
  {
  }
  
  -(void)audioPlayerEndInterruption:(AVAudioPlayer *)player
  {
  }
  
  @end
  </code></pre>
  <p>What are these errors and how can i fix them ?</p>
  <p><strong>NOTE:</strong> i searched for those errors and didn't find a solution.</p>